Wednesday, March 25, 2009

R variable class (data types)

R does some amazing things, and often seems to know just want you want to do. Data type "coercion" can also backfire.

I just discovered a great way to check to see how R has interpreted the columns of a file you have just loaded.

> sapply(dataframeobject, class)
gender type score
"factor" "factor" "numeric"

No comments:

Post a Comment