
Last chance! 50% off unlimited learning
Sale ends in
Function checks of which type a variable is. The types are listed below (together with a rough summary of the classification mechanism).
continuous (numeric values, or integers with more than 20 different values),
semicontinuous (numeric values with more than 10% of them share the same value),
rounded continuous (if more than 50% of the observations of a continuous variable are divisible by some rounding degrees)
count data (integers).
an intercept (the same value for all observations),
binary (two different values - like 0s and 1s or "m" and "f"),
categorical (the variable is a factor or has more than 3 different values)
ordered categorical (the categorical variable is ordered.)
get_type(variable, spike = NULL, rounding_degrees = c(1, 10, 100,
1000))
A variable (vector) from your data set.
A numeric value, denoting the presumed spike of semi-continuous variables.
A numeric vector with the presumed rounding degrees.
If the rounding_degrees are set to be NULL
, the proposed rounding degrees from the function
suggest_rounding_degrees
are used.
A character denoting the type of variable
.
# NOT RUN {
get_type(iris$Sepal.Length); get_type(iris$Species)
# }
Run the code above in your browser using DataLab