Coder Social home page Coder Social logo

owidr's Issues

Invalid char in json text

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))

error: Problem with `id`

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 in y must be present in the data.
✖ Problem with id.

A backtrace suggests that maybe the id label or values are missing?:

  1. ├─owidR::owid("share-graduates-stem-female")
  2. │ └─... %>% arrange(entity, year)
  3. ├─dplyr::arrange(., entity, year)
  4. ├─dplyr::select(., entity = name, code, year = years, values)
  5. ├─dplyr::left_join(., entities, by = c(entities = "id"))
  6. └─dplyr:::left_join.data.frame(., entities, by = c(entities = "id"))
  7. └─dplyr:::join_mutate(...)
  8. └─dplyr:::join_cols(...)
    
  9.   └─dplyr:::check_join_vars(by$y, y_names, by$condition, "y", error_call = error_call)
    
  10.     └─rlang::abort(bullets, call = error_call)
    

Fail to retrieve some datasets

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.