Hi everyone:

I need to count the number of banks of each firm in my data. The firm is identified by the fiscal number. The banks of each firm appears like this:

Firm                     Banks
500600700          Citybank
500600700          CGD
500600700          BES
500600800          Citybank
500600800          Bank1
500600900          CGD
…

I want to obtain the following dataframe:
Firm            numberofbanks
500600700          3
500600800          2
500600900          1
…

This is a question of counting the times each firm appears, but I don’t know which function do this. If anyone could help me I appreciate.

Thank you in advance for the help you could give me,

Cecilia Carmo (Portugal)

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to