use_data: Use data in a package.

Description Usage Arguments See Also Examples

View source: R/infrastructure.R

Description

This function makes it easy to save package data in the correct format.

Usage

1
2
use_data(..., pkg = ".", internal = FALSE, overwrite = FALSE,
  compress = "bzip2")

Arguments

...

Unquoted names of existing objects to save.

pkg

Package where to store data. Defaults to package in working directory.

internal

If FALSE, saves each object in individual .rda files in the data/ directory. These are available whenever the package is loaded. If TRUE, stores all objects in a single R/sysdata.rda file. These objects are only available within the package.

overwrite

By default, use_data will not overwrite existing files. If you really want to do so, set this to TRUE.

compress

Choose the type of compression used by save. Should be one of "gzip", "bzip2" or "xz".

See Also

Other infrastructure: infrastructure, use_build_ignore, use_data_raw, use_news_md, use_package, use_readme_rmd

Examples

1
2
3
4
5
6
7
8
## Not run: 
x <- 1:10
y <- 1:100

use_data(x, y) # For external use
use_data(x, y, internal = TRUE) # For internal use

## End(Not run)


devtools documentation built on May 19, 2017, 8:55 p.m.
Search within the devtools package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.