Left Join Error - Trying to Join England Region Map data with another dataframe

Hi my left join for two data frames is returning null values in the sense that. I am trying to join a dataframe with all the regions in the UK to an england multipolygon sf dataframe. The issue is after the left join the geometry points come back empty. Please help.

england_maps <- england_map %>%
mutate(NUTS_NAME= str_remove(NUTS_NAME,".*/"),
NUTS_NAME= str_trim(NUTS_NAME),
NUTS_NAME=record(NUTS_NAME, "SOUTH EAST (ENGLAND)", "SOUTH WEST (ENGLAND)", "NORTH EAST (ENGLAND)","NORTH WEST (ENGLAND)","YORKSHIRE AND THE HUMBER", "EAST MIDLANDS (ENGLAND)", "WEST MIDLANDS (ENGLAND)","EAST OF ENGLAND","LONDON")) %>%
right_join(diagnosis_1822, by = c("NUTS_NAME"))

Hi @31121993, for get a better help try to put a reproducible example of data.

Why you use c in right_join? In R we use c for concatenate values of a vector not for one.

I agree with @M_AcostaCH that we need a reproducible example. Also, your question says "after the left join" but the code contains a right join. Regarding the empty fields, do they come from the mutated england_map data frame or the diagnosis_1822 data frame?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.