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


You need to login to view comments.