Determines the valueType of an object based on typeof()
and
class()
. The possible values returned are 'date', 'datetime', 'boolean',
'integer', 'decimal', and 'text'.
valueType_of(x)
Object. Can be a vector.
A character string which is the valueType of the input object.
The valueType is a declared property of a variable that is required in certain functions to determine handling of the variables. Specifically, valueType refers to the OBiBa data type of a variable. The valueType is specified in a data dictionary in a column 'valueType' and can be associated with variables as attributes. Acceptable valueTypes include 'text', 'integer', 'decimal', 'boolean', datetime', 'date'. The full list of OBiBa valueType possibilities and their correspondence with R data types are available using valueType_list. The valueType can be used to coerce the variable to the corresponding data type.
{
# use madshapR_examples provided by the package
dataset <- madshapR_examples$`dataset_example`
valueType_of(dataset[['part_id']])
# any data frame can be dataset by definition
valueType_of(iris[['Sepal.Length']])
}
#> [1] "decimal"