0

This seems like a very simple problem, but I can't seem to sort it out. I have sought help from this forum, with the below topics being close, but don't seem to do exactly what I need. I have count data over several years. I want to obtain frequencies of the count value by year. It seems I need a table function with a grouping option, but I haven't found the proper syntax.

Data:
          count year
    1        15 1957
    2         6 1957
    3        23 1957
    4        23 1957
    5         2 1957
    6        28 1980
    7        15 1980
    8        32 1980
    9        18 1981

thank you in advance!

Counting the number of elements with the values of x in a vector

grouping data splitted by frequencies

Aggregate data in R

4

1 回答 1

2

您正在寻找table功能。就像是:

with(yourdata, table(Year, Count))
于 2013-09-05T14:15:24.220 回答