This function wraps the functionality of usethis::use_data() and stw_write_roxygen() to write a data-frame (or tibble) to your package data, as well as to write the Roxygen-documentation to a file in your package's R directory.

stw_use_data(
  ...,
  file_doc = NULL,
  keep_steward = FALSE,
  overwrite = FALSE,
  compress = "bzip2",
  version = 2
)

Arguments

...

Unquoted names of existing objects to save.

file_doc

character name of the Roxygen-documentation file to be written to the package's R directory; default is "data-{name-of-first-dataset}.R"

keep_steward

logical indicates to keep the steward classes and attributes when writing the dataset to 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".

version

The serialization format version to use. The default, 2, was the default format from R 1.4.0 to 3.5.3. Version 3 became the default from R 3.6.0 and can only be read by R versions 3.5.0 and higher.

Value

invisible(NULL), called for side-effects