replace - gsub required for character + using R -
i'm new r. i'm stucked on step project. i'm unable gsub character + example if have string khjvg+56a result should khjvg56a.
here i'm trying.
gsub('^+[[:punct]]', "", 'khjvg+56a') but getting same string passed
does solve problem?
gsub('[[:punct:]]', "", 'khjvg+56a') i think don't need ^ (beginning of line) , 1 : missing.
as stated @nicola, gsub('\\+', "", 'khjvg+56a') more specific +, `[[:punct:]] target punctuation sign.
Comments
Post a Comment