This has to be an incredibly easy task (and yeah this will probably be marked as a duplicate) but I can't find ANYWHERE how to do this simply within a dataframe without creating lists from the columns and putting them back. Reproducible code below:
I simply wish to separate the last element in the column df, delimited by comma:
df<- c("Lagos, Nigeria", "United States", "Buckingham Palace, Great Britain",
"Madison Square Garden, NY, New York, USA")
df <- data.frame(df, c(1:length(df)), stringsAsFactors = FALSE)
df$column.desired <- c("Nigeria", "United States", "Great Britain",
"USA")