worldbank / dkanr

General purpose R client to the DKAN Open Data platform
Other
7 stars 3 forks source link

Add "url" argument to fix_download_url() function #25

Open tonyfujs opened 6 years ago

tonyfujs commented 6 years ago

Problem: returns blank URL is dkanr_setup() is not run at the beginning

fix_download_url <- function(download_url) { base_url <- file.path(get_url(), dkfiles())

out <- stringr::str_replace( download_url, pattern = "^public:", replacement = base_url )

return(out) }