dickoa / rhdx

R package to interact with the Humanitarian Data Exchange portal - http://dickoa.gitlab.io/rhdx/
Other
26 stars 6 forks source link

Error in basename(self$data$url) : path too long #3

Open bmpacifique opened 4 years ago

bmpacifique commented 4 years ago

remotes::install_gitlab("dickoa/rhxl") ## rhdx dependency remotes::install_gitlab("dickoa/rhdx") ## github mirror also avalailable install.packages("gifski") library(tidyverse) library(sf) library(rhdx) library(gganimate) set_rhdx_config() wca <- pull_dataset("west-and-central-africa-administrative-boundaries-levels") %>% get_resource(1) %>% read_resource(folder = "/data")

reading layer: wca_adm0

glimpse(wca) g5_ab <- wca %>% filter(admin0Pcod %in% c("BF", "ML", "NE", "MR", "TD")) g5_ab %>% ggplot() + geom_sf() + theme_minimal() solr_query <- "organization:acled AND groups:(mli OR bfa OR tcd OR mrt OR ner)" g5_acled <- search_datasets(query = "conflict data", fq = solr_query) g5_acled <- g5_acled[1:5] ## pick the first 5 the 6th is the Africa wide dataset

create a helper function to read resources from each dataset

read_acled_data <- function(dataset) { dataset %>% get_resource(1) %>% read_resource(force_download = TRUE) } g5_acled_data <- map_df(g5_acled, read_acled_data)

dickoa commented 4 years ago

@bmpacifique I hope all is good, I made a commit that is fixing this issues on my machine. Can you please check and report back so that we can close the issue. Thanks again