shortcuts is an R package for circumventing common, cumbersome base R operations.
factor.as.numeric()
> library(devtools)
> install_github("gnapham/shortcuts")
yourVector <- as.factor(c(1,1,2,2,4,4,4,5,5,5,5))
# this will not work intuitively for numbers mistakingly categorized as factors.
as.numeric(yourVector)
[1] 1 1 2 2 3 3 3 4 4 4 4
# use this instead.
factor.as.numeric(yourVector)
[1] 1 1 2 2 4 4 4 5 5 5 5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.