Generates the code for a check_data() call from an example data frame so
the column specification does not have to be written out by hand.
Usage
generate_check_data(x, data_name = NULL)
Value
A string of the generated code, invisibly.
Arguments
x
A data frame to generate the check_data() code from.
data_name
A string of the name to use for the data frame in the
generated code or NULL to use the name of x.
Details
For each column the generated values entry captures
the column's class,
whether it permits missing values,
the range (minimum and maximum) of numeric, Date and POSIXct
columns, and
the levels of factors.
The result is a starting point that is expected to be edited, for example to
widen a range or relax a set of factor levels. The code is printed to the
console (so it can be copied) and returned invisibly as a string.