import_data | R Documentation |
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(...)
.
import_data(package, dataname, lib.loc = .libPaths())
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). |
Returns the data directly.
Thus, one can assign the data like so: mydata <- import_data(...)
.
tinycodet_import
d <- import_data("datasets", "cars")
head(d)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.