Convert Factor Levels to Numeric in R


/ Published in: R
Save to your folder(s)

Slightly more efficient than "as.numeric(as.character(f))"


Copy this code and paste it in your HTML
  1. as.numeric(levels(f))[f]

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.