Quotes help make search much faster. Example: "Practice Makes Perfect"

Tuesday, October 22, 2013

In R, how do you determine the unique elements in a vector?


Answer:

someFactor <- factor(someVector)
//convert the vector to a factor using the factor function

levels(someFactor)
//use the levels function to identify the unique elements in the vector

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts