I have two unequal lengths of data frame.
The first df is 100K+rows containing Hotel Names with cities or without cities, example-
structure(list(Hotel Name
= c("ancdr Wyndam NY vbhejn", "rifhwe Wynham SFO fgrnhie",
"efuaschiw Marriott DC fgyweuinh", "hfeiwefj Marriott elsn"),
Col2 = c("x", "x", "x", "x"), Col3 = c("x", "x", "x", "x"
), Col 4
= c("x", "x", "x", "x")), row.names = c(NA, -4L
), class = c("tbl_df", "tbl", "data.frame"))
The second df is ~100 rows containing city names, example -
Cities
NY
SFO
DC
My desired output should only be those rows from first data frame which have city names from second data frame:
Hilton NY
Marriott NY
Wyndham NY
I tried using %in% but it's returning an error saying unequal length of rows