Skip to content
Prev 262569 / 398502 Next

Odp: log2() and -min() very quick question

Hi

r-help-bounces at r-project.org napsal dne 13.06.2011 17:59:03:
learn
as.matrix(read.delim("rel.abundance.csv",row.names=1,as.is
takes
in
No. If rel.abundance is matrix min(rel.abundance) is overall minimum
[1] 1

so
log2(rel.abundance-min(rel.abundance)+1)

subtract minimum value from all numbers, after that it add 1 do all 
numbers, takes log base 2 from each number and returns matrix with the 
same dimensions as input matrix.
better
line
Methanobacteriaceae|Methanobrevibacter,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,3,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,
think
there are some summary and structure commands

summary(data) or str(data)

which can tell you some overall information about your data.

Regards
Petr
http://www.R-project.org/posting-guide.html