This function is designed to ease the changes of column's class of a given data frame.
setColClass(x, colid, cls)
x | a data frame or an R object to be coerced into a data frame. |
---|---|
colid | the identity of columns for which class are to be changed. |
cls | a character vector containing the classes' names to be used in the
same order as |
A data frame whose columns have the desired classes.
#> num [1:10, 1:2] 0.6433 0.3144 0.2275 0.0635 0.0785 ...#> 'data.frame': 10 obs. of 2 variables: #> $ V1: num 0.6433 0.3144 0.2275 0.0635 0.0785 ... #> $ V2: chr "0.9258" "0.9202" "0.152" "0.6542" ...