View source: R/dpapplyschema.R
dpapplyschema | R Documentation |
Convert columns of data.frame to their correct types using table schema
dpapplyschema(dta, resource, to_factor = FALSE, ...)
dta |
a |
resource |
an object with the Data Resource of the data set. |
to_factor |
convert columns to factor if the field descriptor a
|
... |
additional arguments are passed on to the |
Converts each column in dta
to the correct R-type using the type
information in the table schema. For example, if the original column type in
dta
is a character vector and the table schema specifies that the field is
of type number, the column is converted to numeric using the decimal
separator and thousands separator specified in the field descriptor (or default values
for these if not).
This function calls conversion functions for each of the columns, see
to_number
, to_boolean
, to_integer
,
and to_date
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.