| import_data {tinycodet} | R Documentation |
Directly Return a Data-set From a Package
Description
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())
Arguments
package |
a single string, giving the name of the R-package. |
dataname |
a single string, giving the name of the data set. |
lib.loc |
character vector specifying library search path
(the location of R library trees to search through). |
Value
Returns the data directly.
Thus, one can assign the data like so: mydata <- import_data(...).
See Also
Examples
d <- import_data("datasets", "cars")
head(d)
[Package tinycodet version 0.5.3 Index]