Make example data available, typically for use in teaching.

loadExampleData(name = "list", envir = globalenv(), verbose = TRUE)

Arguments

name

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.

envir

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.

verbose

A logical scalar. If TRUE, report what is being selected and made available.

Value

A data.frame (invisibly) with one row for each dataset that was made available in the global environment.

Author

Michael Stadler

Examples

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`