View source: R/datalow_utils.r
facttonum | R Documentation |
facttonum converts a vector of numeric factors into numbers. If the factors are not numeric then the outcome will be a series of NA. It is up to you to apply this function only to numeric factors. A warning will be thrown if the resulting output vector contains NAs
facttonum(invect)
invect |
the vector of numeric factors to be converted back to numbers |
an output vector of numbers instead of the input factors
## Not run:
DepCat <- as.factor(rep(seq(100,600,100),2)); DepCat
5 * DepCat[3]
as.numeric(levels(DepCat)) # #only converts the levels not the replicates
DepCat <- facttonum(DepCat)
5 * DepCat[3]
x <- factor(letters)
facttonum(x)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.