2

Possible Duplicate:
Count unique values in R

I have just one column full of names, and I need to know how many times each name is on this column.

I can do a

summary(dfUL)

where dfUL is my user list data frame

This will give me a summary with the number of times a particular value is repeated, but it will only do it for the top 6. How can i do that for the entire data frame?

Community
  • 1
  • 1
vonHippie
  • 69
  • 1
  • 1
  • 6

2 Answers2

8

Did you try already table(dfUL)?

johannes
  • 14,043
  • 5
  • 40
  • 51
2

Another possibly useful method would be the match() function.

match(x,dfUL$somecol) #Where x is the value in somecol you are looking for
match(max(dfUL$somecol),dfUL) #Returns the row with the maximum value of somecol
forestman
  • 189
  • 5