piersyork / owidr Goto Github PK
View Code? Open in Web Editor NEWAn R Package for Importing Data from Our World in Data
License: Other
An R Package for Importing Data from Our World in Data
License: Other
Hello,
I am getting an error fetching the JSON from ourworldindata - worked just fine a couple of days ago.
The error is as follows:
Error: lexical error: invalid char in json text.
https://ourworldindata.org/grap
(right here) ------^
The issue is most likely in line 114 of owid.R:
data <- jsonlite::fromJSON(data_url)
As they suggest on stackoverflow, it should be enough to add a readLines(), like this:
data <- jsonlite::fromJSON(readLines(data_url))
When I try to import a dataset from owid (e.g., tempdata <- owid("share-graduates-stem-female")), I get the following error:
Error in
left_join()
:
! Join columns iny
must be present in the data.
✖ Problem withid
.
A backtrace suggests that maybe the id
label or values are missing?:
- ├─owidR::owid("share-graduates-stem-female")
- │ └─... %>% arrange(entity, year)
- ├─dplyr::arrange(., entity, year)
- ├─dplyr::select(., entity = name, code, year = years, values)
- ├─dplyr::left_join(., entities, by = c(entities = "id"))
- └─dplyr:::left_join.data.frame(., entities, by = c(entities = "id"))
- └─dplyr:::join_mutate(...)
└─dplyr:::join_cols(...)
└─dplyr:::check_join_vars(by$y, y_names, by$condition, "y", error_call = error_call)
└─rlang::abort(bullets, call = error_call)
When i run:
owid("population-density")
I get the following error:
Error in `*tmp*`[[1]] : subscript out of bounds
The same happens when I run owid("co2-intensity")
However, running owid("ocean-plastic-waste-per-capita-vs-gdp")
returns the data as requested.
I'm using owidR version 1.4.2.9000.
Session info
R version 4.3.2 (2023-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)
read_html is in xml2?
Hi! very useful package, tahnks!
I´m receiving this error when running owid("human-rights-protection")
:
"Error in open.connection(con, "rb") :
cannot open the connection to 'https://ourworldindata.orghttps://api.ourworldindata.org/v1/indicators/358.data.json'
In addition: Warning message:
In open.connection(con, "rb") :
URL 'https://ourworldindata.orghttps//api.ourworldindata.org/v1/indicators/358.data.json': status was 'Couldn't resolve host name'"
Best,
Iván
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.