The import_data() function gets a specified data set from a package.
Unlike utils::data(), the import_data() function returns the data set directly,
and allows assigning the data set like so: mydata <- import_data(...).
Usage
import_data(package, dataname, lib.loc = .libPaths())Examples
d <- import_data("datasets", "cars")
head(d)
#> speed dist
#> 1 4 2
#> 2 4 10
#> 3 7 4
#> 4 7 22
#> 5 8 16
#> 6 9 10