altair (version 4.1.1)

import_vega_data: Import Vega datasets

Description

Lets you access Vega datasets.

Usage

import_vega_data()

Arguments

Value

An S3 object of class vega_datasets.core.DataLoader

Details

Returns the data object in the Python package vega-datasets. In the documentation for this package, the convention is to assign this object to the name vega_data.

See Also

Vega datasets documentation

Examples

Run this code
# NOT RUN {
if (interactive()) {
  vega_data <- import_vega_data()

  # To list available datasets
  print(vega_data$list_datasets())

  # When accessing a dataset, substitute any "-" in the name with a "_"
  print(head(vega_data$sf_temps()))

  # Metadata are available for each dataset:
  print(vega_data$anscombe$references)
  print(vega_data$anscombe$description)
  print(vega_data$anscombe$url)

  # For local datasets, local path is available
  print(vega_data$sf_temps$filepath)
}
# }

Run the code above in your browser using DataCamp Workspace