r - Extract all information AFTER a comma in a data frame column -


how can extract information after comma data frame column in r?

polyname south dakota,minnehaha colorado,larimer nebraska,adams nebraska,adams nebraska,adams 

i want return column like

counties minnehaha larimer adams adams adams 

try

 df1$counties <- sub('^[^,]+,', '', df1$polyname) 

Comments

Popular posts from this blog

html - height not adding height to a empty div -

python - Robot Framework location and name of keyword -

Desktop Launcher for Python Script Starts Program in Wrong Path (Linux) -