This package requires a valid API auth token to work.
Configuration can be provided in 3 forms:
Config files are the most convenient configuration method. Once saved configuration will be automatically restored when data.world is loaded.
From the R console:
saved_cfg <- data.world::save_config("YOUR API TOKEN")
data.world::set_config(saved_cfg)To obtain your API token, visit: https://data.world/settings/advanced For additional configuration options, see ?set_config
Use the data.world package to retrieve data from the site using SQL or SPARQL.
Here is an example:
intro_ds <- "https://data.world/jonloyens/an-intro-to-dataworld-dataset"
team_df <- data.world::query(
data.world::qry_sql("SELECT * FROM DataDotWorldBBallTeam"),
dataset = intro_ds
)
team_dfFor additional examples, including parameterized queries and SPARQL, see query vignette.
The dwapi package simplifies access to data.world REST APIs. dwapi is bundled and automatically loaded with data.world. Using it you can create and update datasets, upload data and update metadata, among other things.
For example, to get the definitions of a dataset, you can:
intro_def <- dwapi::get_dataset(intro_ds)
intro_def$descriptionTo learn more about data.world’s REST API, checkout https://docs.data.world/documentation/api and ?dwapi.