You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was the error I was getting, but I am not sure if the modification is changing anything that shouldn't be changed.
Error in dplyr::select(., name, continent) :
trying to get slot "data" from an object (class "sf") that is not an S4 object followed by world_sp <- merge(world_sp, cor_df, by = "country_name", all.x = T, all.y = F)
The text was updated successfully, but these errors were encountered:
Looks like the ne_countries function using the latest version of the rnaturalearth package makes an sf polygon. The below figures assume world_sp is sp, not sf -- so fixed this by converting world_sp to an sp object.
big-data-poverty-estimation/DataWork/05_figures_tables_global/main/levels_2_global_scatterplot_average_map.R
Line 206 in 5b69a88
Changed this to:
world_sp <- world_sp %>% dplyr::select(name, continent) %>% dplyr::rename(country_name = name) %>% dplyr::mutate(country_name = case_when( country_name %in% "Dem. Rep. Congo" ~ "Congo - Kinshasa", country_name %in% "Côte d'Ivoire" ~ "Côte d’Ivoire", country_name %in% "Dominican Rep." ~ "Dominican Republic", country_name %in% "Swaziland" ~ "Eswatini", country_name %in% "Myanmar" ~ "Myanmar (Burma)", TRUE ~ country_name ))
This was the error I was getting, but I am not sure if the modification is changing anything that shouldn't be changed.
Error in dplyr::select(., name, continent) :
trying to get slot "data" from an object (class "sf") that is not an S4 object followed by world_sp <- merge(world_sp, cor_df, by = "country_name", all.x = T, all.y = F)
The text was updated successfully, but these errors were encountered: