View source: R/document_data.R
This function generates R
documentation for one or more datasets. You
need to provide a data frame with a description of each dataset and a data
frame with a description of each variable. Whenever you update these data
frames, you can easily regenerate the R
documentation without making
the changes in multiple places. Running this function generates one .R
file per dataset and saves these files in the folder indicated by the
path
argument. If you're developing an R
package, this path
should be to the R/
folder in your package directory. After you run
document_data()
to produce an .R
file for each dataset, you can
run roxygen2
using devetools::document()
to generate a
.Rd
(R
documentation) file for each dataset. These .Rd
files will be saved to the man/
folder, as usual.
1 2 3 4 5 6 7 8 | document_data(
file_path,
variables_input,
datasets_input,
include_variable_type = FALSE,
author = NULL,
package = NULL
)
|
file_path |
The path to the folder where the output file should be
saved. If you're developing an |
variables_input |
A data frame containing infromation on each variable.
This data frame must include: (1) a variable called |
datasets_input |
A data frame containing information on each dataset.
This data frame must include: (1) a variable called |
include_variable_type |
A logical value indicating whether to include
the type of the variable in the variable description. The
|
author |
Optional. A string or string vector indicating the name of the
package author(s). If provided, these names will be included in the header
of each |
package |
Optional. A string indicating the name of the package that the
data will be distributed in. If provided, the name of the package will be
included in the header of each |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.