Use plyr library (is in the basic package of R)
Or you can install it with:
install.packages("plyr")
library(plyr)
Use the function "count" in the plyr library. To count in all dataset, set from 1 to X. Where x is number of lines in your data set and the name of the column in "vars".
count(data[1:5734,],vars="GOslim_bin")
GOslim_bin freq
1 DNA metabolism 84
2 RNA metabolism 485
3 cell adhesion 128
4 cell cycle and proliferation 229
5 cell organization and biogenesis 454
6 cell-cell signaling 63
7 death 238
8 developmental processes 487
9 other biological processes 919
10 other metabolic processes 779
11 protein metabolism 583
12 signal transduction 473
13 stress response 294
14 transport 518
I made a script to count data in R. I share if anyone wants to use it sometime. Nico.
Counting data in R
Count occurrences in a column.
Make sure that the data are read.
Count lines and see the name of each column.
Use plyr library (is in the basic package of R) Or you can install it with:
Use the function "count" in the plyr library. To count in all dataset, set from 1 to X. Where x is number of lines in your data set and the name of the column in "vars".
You can make an object with that for graphics: