Convert a vector (such as a dataframe column) from factor to numeric. Non-numeric values will coerce to NA.
Usage
unfactor(x)
Value
A vector of numeric values is returned.
Arguments
x
A vector of type factor. Typically this would be one column of a dataframe.
Author
Neville Jackson
Details
This function may be useful when preparing a dataframe for dmm(). It is a common problem for dataframe columns to be automatically made type factor when constructing the dataframe with functions such as read.table, due to the presence of a small number of non-numeric values. Dataframe columns used as traits or as covariates should not be of type factor.