Description Usage Arguments Value Examples
View source: R/c14_date_list_enforce_types.R
Enforce variable types in a c14_date_list and remove
everything that doesn't fit (e.g. text in a number field).
See the
variable_reference
table for a documentation of the variable types.
enforce_types()
is called in c14bazAAR::as.c14_date_list()
.
1 2 3 4 5 6 7 | enforce_types(x, suppress_na_introduced_warnings = TRUE)
## Default S3 method:
enforce_types(x, suppress_na_introduced_warnings = TRUE)
## S3 method for class 'c14_date_list'
enforce_types(x, suppress_na_introduced_warnings = TRUE)
|
x |
an object of class c14_date_list |
suppress_na_introduced_warnings |
suppress warnings caused by data removal in type transformation due to wrong database entries (such as text in a number column) |
an object of class c14_date_list
1 2 3 4 5 6 7 8 9 10 11 | # initial situation
ex <- example_c14_date_list
class(ex$c14age)
# modify variable/column type
ex$c14age <- as.character(ex$c14age)
class(ex$c14age)
# fix type with enforce_types()
ex <- enforce_types(ex)
class(ex$c14age)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.