How do I get every character after a segment in my column in R?

Fake City, TX Court House I would like to return: Court House This is what I have from another post. I used it to be able to extract the city piece. gsub(",.*$", "", COLUMN$Entity) My gut tells me that ",.*$ will have to change but I’m not sure what to change it to. I’m new… Read More How do I get every character after a segment in my column in R?

combine the row with the different variable

i want to combining 2 dataframe but there are diferent variable example df1=data.frame(x1=c(1,1,1,2,2,2,2),x2=c("a","a","b","b","c","c","c"),x3=c("t","u","v","w","x","y","z"),x4=c("apple","apple","mango","mango","mango","mango","mango")) df2=data.frame(x1=c(1,1,1,2,2,2,2),x2=c("a","a","b","b","c","c","c"),x4=c("apple","banana","banana","melon","melon","melon","melon"),x5=c("t","u","v","w","x","y","z")) i’d tried with cbind, rbind, merge, right and left join, but no one can like I expected. my expectation in df is there 13 row and 5 column. why 13 column? because in row 1 can combined >Solution : You could… Read More combine the row with the different variable