Make example data available, typically for use in teaching.
loadExampleData(name = "list", envir = globalenv(), verbose = TRUE)
An optional character scalar specifying the data set(s) to
be made available. The special name "list"
(default) is used to
print a data frame of available data sets with descriptions. The special
name "latest"
will select the latest data set(s) available.
specifies the environment in which the data should be made
available. By default, envir = globalenv()
, which creates the
example data objects in the user workspace. Possible alternative
environment are for example parent.frame()
, which is the
environment in which loadExampleData()
was called.
A logical scalar. If TRUE
, report what is being
selected and made available.
A data.frame
(invisibly) with one row for each dataset
that was made available in the global environment.
loadExampleData()
#> name created description
#> 1 mycars 2023-05-23 re-encoded version of `datasets::mtcars`
#> 2 mycars_summary 2023-05-23 summary of `datasets::mtcars` (`hp` by `cyl`)
#> 3 2023-05 2023-05-24 collection: mycars, mycars_summary
#> is_collection
#> 1 FALSE
#> 2 FALSE
#> 3 TRUE
loadExampleData("mycars")
#> `mycars`: re-encoded version of `datasets::mtcars`