Posts Tagged ‘ vector ’

Converting vectors to numeric in mixed-type dataframe

May 19, 2011

Coercing variables of character and numeric type into a single dataframe yields all vectors to be defined as factors all <- data.frame(cbind(site, year, model, x, y, z)) The following converts selected variables from “factor” back to “numeric” all$x <- as.numeric(x) … Continue reading →

Read more »


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)