use_iface | R Documentation |
Generating and documenting an iface
for a given dataframe would be time
consuming and annoying if you could not do it automatically. In this case as
you interactively develop a package using a test dataframe, the structure of
which can be explicitly documented and made into a specific contract within
the package. This supports development using test dataframes as a prototype
for function ensuring future user input conforms to the same expectations as
the test data.
use_iface(
df,
name = deparse(substitute(df)),
output = "R/interfaces.R",
use_as_default = FALSE,
pkg = "."
)
df |
the data frame to use |
name |
the name of the variable you wish to use (defaults to whatever the dataframe was called) |
output |
where within the current package to write data documentation
code (defaults to |
use_as_default |
if this is set to true the current dataframe is saved
as package data and the |
pkg |
the package (defaults to current) |
nothing, used for side effects.
# example code
if (interactive()) {
# This is not run as it is designed for interactive use only and will
# write to the userspace after checking that is what the user wants.
use_iface(iris)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.