You can display all unique values from a variable in R using the unique()
function. This function returns a vector of unique values in the order in which they appear in the original vector.
Here's an example:
main.r227 chars9 lines
This will output:
main.r18 chars2 lines
Note that the unique() function can also be used with data frames and other data structures in R.
gistlibby LogSnag