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
As reported in sharlagelfand/opendatatoronto#11 - there seems to be an issue with reading some CSVs (maybe they're malformed? I haven't looked at the underlying data set quite yet) in read.csv() that something like readr::read_csv() manages just fine.
I'm not sure we want to switch read_session() over to use readr::read_csv() and add that dependency, but maybe could use it as a fallback.
Reprex:
library(ckanr)
library(readr)
id<-"3f93fcb0-c842-4b56-8988-4a84c880b86d"resource<- resource_show(id, url="https://ckan0.cf.opendata.inter.prod-toronto.ca/", as="list")
fetched_resource<- ckan_fetch(resource[["url"]])
#> Warning in scan(file = file, what = what, sep = sep, quote = quote, dec = dec, :#> EOF within quoted string# Versus via readr::read_csv() - bunch of manual steps since this one is in a ZIP# Make a directory to save intodir<- tempdir()
resource_dir<-fs::dir_create(paste0(dir, "/", id))
# Save the ZIP filesave_path<- ckan_fetch(resource[["url"]], store="disk", path= paste0(dir, "/", id, "/", "res.zip"))
# Unzip itcsv_files<- unzip(save_path[["path"]], exdir=resource_dir)
# Read it in readr_resource<- read_csv(csv_files, show_col_types=FALSE)
# Compare dims of resources
dim(fetched_resource[[1]])
#> [1] 135718 30
dim(readr_resource)
#> [1] 246434 30
I will look into this more, but reporting here to keep track of.
The text was updated successfully, but these errors were encountered:
As reported in sharlagelfand/opendatatoronto#11 - there seems to be an issue with reading some CSVs (maybe they're malformed? I haven't looked at the underlying data set quite yet) in
read.csv()
that something likereadr::read_csv()
manages just fine.I'm not sure we want to switch
read_session()
over to usereadr::read_csv()
and add that dependency, but maybe could use it as a fallback.Reprex:
I will look into this more, but reporting here to keep track of.
The text was updated successfully, but these errors were encountered: