Home > Mobile >  How to use function "get_data_structure"
How to use function "get_data_structure"

Time:12-07

I try to use the function "get_data_structure" but got an error as below. Could anyone know how to fix it?

Thank you in advance

get_data_structure("DUR_D") Error in data.frame(data_structure@concepts) : trying to get slot "concepts" from an object (class "data.frame") that is not an S4 object

CodePudding user response:

The problem appears to be a bug in the version of the OECD package on CRAN. If you install the development version, it works. First, close R and reopen a clean new session, then run this:

remotes::install_github("https://github.com/expersso/OECD")

library(OECD)
get_datasets()
get_data_structure("DUR_D")

CodePudding user response:

remotes::install_github("https://github.com/expersso/OECD")

library(OECD)    
dataset <- "DUR_D"
dstruc <- get_data_structure(dataset)

Try with get_dataset("DUR_D") i.e. without -s. as get_datasets() with -s will return a dataframe of available datasets.

  •  Tags:  
  • r
  • Related