DEPRECATED: Please use Discord: https://discord.gg/2UgfM2k. (Updated Dec 2020)
# Load client
library(datapkg)
# Get Data Package
datapackage <- datapkg_read("https://pkgstore.datahub.io/JohnSnowLabs/diagnosed-diabetes-prevalence-2004-2013/latest")
#> Reading file https://pkgstore.datahub.io/JohnSnowLabs/diagnosed-diabetes-prevalence-2004-2013/latest/https://pkgstore.datahub.io/JohnSnowLabs/diagnosed-diabetes-prevalence-2004-2013:diagnosed-diabetes-prevalence-2004-2013-csv_csv/data/diagnosed-diabetes-prevalence-2004-2013-csv_csv.csv
#> Reading file https://pkgstore.datahub.io/JohnSnowLabs/diagnosed-diabetes-prevalence-2004-2013/latest/https://pkgstore.datahub.io/JohnSnowLabs/diagnosed-diabetes-prevalence-2004-2013:diagnosed-diabetes-prevalence-2004-2013-csv_csv_preview/data/diagnosed-diabetes-prevalence-2004-2013-csv_csv_preview.json
#> Warning: Unnamed `col_types` should have the same length as `col_names`.
#> Using smaller of the two.
#> Error in nchar(x): invalid multibyte string, element 2
library(datapkg)
datapackage <- datapkg_read("https://pkgstore.datahub.io/JohnSnowLabs/diagnosed-diabetes-prevalence-2004-2013/latest/datapackage.json")
#> Reading file https://pkgstore.datahub.io/JohnSnowLabs/diagnosed-diabetes-prevalence-2004-2013/latest/https://pkgstore.datahub.io/JohnSnowLabs/diagnosed-diabetes-prevalence-2004-2013:diagnosed-diabetes-prevalence-2004-2013-csv_csv/data/diagnosed-diabetes-prevalence-2004-2013-csv_csv.csv
#> Reading file https://pkgstore.datahub.io/JohnSnowLabs/diagnosed-diabetes-prevalence-2004-2013/latest/https://pkgstore.datahub.io/JohnSnowLabs/diagnosed-diabetes-prevalence-2004-2013:diagnosed-diabetes-prevalence-2004-2013-csv_csv_preview/data/diagnosed-diabetes-prevalence-2004-2013-csv_csv_preview.json
#> Warning: Unnamed `col_types` should have the same length as `col_names`.
#> Using smaller of the two.
#> Error in nchar(x): invalid multibyte string, element 2
There is something buggy in the library somewehre - it is trying to read a file that does not exist - as you can see it is repeating the url in the file path (i suspect it is not supportive of dp v1 specs in the path field ...)
I suggest you could load the CSV directly for now in R (which i know somewhat defeats the point) ;-)
e.g.
Or any other links directly from the https://datahub.io/JohnSnowLabs/diagnosed-diabetes-prevalence-2004-2013
@HeidiBaya_twitter :-) - it is so great to have you using the data - please keep the feedback (and bugs) coming so we can fix them. We should have R instructions updated on site this week and hope we will have a usable R lib soon.
In the mean time you could almost just do yourself:
Just open the datapackage.json link:
https://datahub.io/JohnSnowLabs/diagnosed-diabetes-prevalence-2004-2013/datapackage.json (will redirect for you ...)
Open that and look at the resources section and you'll have all the CSV files with schemas etc
Common pattern:
https://datahub.io/{owner}/{dataset-name}/datapackage.json
We also have a dedicated chat channel just for datahub.io at http://gitter.im/datahubio/chat
@jobarratt @pwalsh thanks for the chat today! Here are two projects I mentioned http://github.com/datalets/dribdat & https://github.com/schoolofdata-ch/datacentral
dribdat looks cool :sparkles:
And great to see you here @loleg