Skip to content

dataobservatory-eu/wbdataset

Repository files navigation

wbdataset

Lifecycle: experimental CRAN status [DOI] Codecov test coverage

The goal of wbdataset is to create tidy datasets from Wikidata or a Wikibase instance. The wbdataset package is an extension of the dataset, which in turn is an R package that helps to exchange, publish and combine datasets more easily by improving their semantics. The wbdataset extends the usability of dataset by connecting the Wikibase API with the R statistical environment.

Installation

You can install the development version of wbdataset from GitHub with:

# install.packages("devtools")
devtools::install_github("antaldaniel/dataset")
devtools::install_github("dataobservatory-eu/wbdataset")
library(wbdataset)

Example

This is a basic example which shows you how to solve a common problem:

library(wbdataset)
get_item(qid=c("Q228", "Q347"), 
         language=c("en", "nl"), 
         creator=person("Jane Doe"), 
         title="Small Countries")
#> Downloaded Q228
#> Downloaded Q347
#> Jane Doe (2024). "Small Countries."
#>   qid        label         description                                  language
#>   <hvn_lbl_> <hvn_lbl_>    <hvn_lbl_>                                   <hvn_lb>
#> 1 Q228       Andorra       sovereign microstate between France and Spa… en      
#> 2 Q228       Andorra       land in Europa                               nl      
#> 3 Q347       Liechtenstein country in Central Europe                    en      
#> 4 Q347       Liechtenstein land in Europa                               nl