This R package allows users to easily download all the datasets from a given R package into CSV for further analysis.
The script is a result of much trial-and-error to automate the process of writing datasets to CSV form. No consise way was available online, so I made my own.
Ensure 'devtools' is installed and you are able to install packages from GitHub.
install.packages("devtools")
Install this package as follows:
library(devtools)
devtools::install_github("patrickm663/package2csv")
Load the package:
library(package2csv)
In an R session, run datasets_to_csv(<name of package>, workdir = "<OPTIONAL>")
. Note: If the directory provided is invalid, write.csv()
will throw an error. If workdir =
is not specified, it will use your current working directory.
Multiple packages can be read at once by passing the package names as a vector of strings. For example:
datasets_to_csv(c("MASS", "plyr"))
This is free software with NO WARRANTY offered under BSD 3-Clause.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.