I need to write a function which identifies and removes the "*" character after some numeric values in a vector. I also need that the resultant vector is a numeric vector.
c("21,34,99*", "56,90*", "45*")
I need to remove "*
" which is unwanted.
I want to write function so whenever such data cleaning requirement I can use function and pass certain parameters.
lapply(strsplit(gsub("\\*","",x),","),as.numeric)
? $\endgroup$