nicosegoviac / project Goto Github PK
View Code? Open in Web Editor NEWTEST
TEST
Count occurrences in a column.
##read csv (or txt)
data<-read.csv("qDOD_Cgigas_GOslim_DISTINCT.csv",sep=",")
data
Count lines and see the name of each column.
nrow(data)
names(data)
> nrow(data)
[1] 5734
> names(data)
[1] "CGI_ID" "GOslim_bin" "aspect"
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
CountCGigas<-count(data[1:5734,],vars="GOslim_bin")
CountCGigas
attach(CountCGigas)
Count occurrences in a column.
Red the file. Make sure that the working directory is propiely set it.
##read csv (or txt)
data<-read.csv("qDOD_Cgigas_GOslim_DISTINCT.csv",sep=",")
data
Count lines and see the name of each column.
nrow(data)
names(data)
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
CountCGigas<-count(data[1:5734,],vars="GOslim_bin")
CountCGigas
attach(CountCGigas)
![image](/Users/nicosegovia/Desktop/Project/output/Rplot count.pdf/)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.