Hello everyone,
I'm encountering an issue while running a section of my R code that involves loading and processing point of interest (POI) data. The part of the code causing the error is:
# Load data --------------------------------------------------------------------
if(SURVEY_NAME == "LAGOS_POINTS"){
n_poi_df <- file.path(data_dir, SURVEY_NAME,
"FinalData", "Individual Datasets", "osm", "poi") %>%
list.files(full.names = T,
pattern = "*.Rds") %>%
str_subset("_n_poi_1000m") %>%
map_df(readRDS)
names(n_poi_df) <- names(n_poi_df) %>%
str_replace_all("1000m", "5000m")
} else{
n_poi_df <- file.path(data_dir, SURVEY_NAME,
"FinalData", "Individual Datasets", "osm", "poi") %>%
list.files(full.names = T,
pattern = "*.Rds") %>%
str_subset("_n_poi_5000m") %>%
map_df(readRDS)
}
dist_poi_df <- file.path(data_dir, SURVEY_NAME,
"FinalData", "Individual Datasets", "osm", "poi") %>%
list.files(full.names = T,
pattern = "*.Rds") %>%
str_subset("_dist_poi") %>%
map_df(readRDS)
However, I'm getting the following error:
Error in `dplyr::bind_rows()`:
! Can't combine `..1$osm_mindistmeters_poi_theme_park` <data.frame> and `..2$osm_mindistmeters_poi_theme_park` <double>.
Run `rlang::last_trace()` to see where the error occurred.
It seems like the dplyr::bind_rows()
function is having trouble combining data frames where the osm_mindistmeters_poi_theme_park
column is of different types (data.frame
in one case and double
in another).
Has anyone encountered a similar issue or have any suggestions on how to resolve this? Any help would be greatly appreciated!
Thank you!