| specification.data.frame | R Documentation |
Makes a specification for data.frame. Creates a template based on the data.frame. Uses column names for labels where columns do not have a label attribute. Factors will be encoded. numerics will be rounded to digits and like integers will be expressed as ranges in guide column. Integers and character with less than or exactly tol unique values will be encoded.
## S3 method for class 'data.frame'
specification(x, tol = 10, digits = 20, ...)
x |
object |
tol |
integer |
digits |
integer |
... |
passed arguments |
spec data.frame with columns as follows.
Column name.
A descriptive label. Save and edit as necessary using external tool.
A guide to interpretation. NA for arbitrary character; range [low:high] for integer and numeric; an encoding e.g. //0/no//1/yes// for factor-like items ... save and edit factor labels as necessary using external tool.
For numeric ranges you can add text, such as units. E.g. if default guide is '[0:100]' you can edit to give 'mg [0:100]'. Or you can just substitute 'mg'. guidetext extracts just the character portion, and matches enforces the numeric range.
An R expression that can be coerced to logical. TRUE means item cannot be NA.
Arbitrary comment, e.g. derivation of the item given by column.
link{read.spec} write.spec respecify.character write.spec matches
Other specification:
specification.comment(),
specification.default(),
specification()
data(drug)
file <- tempfile()
spec <- specification(drug, tol = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.