Re: [R] adding up elements within a list

2011-05-17 Thread Martin Hughes
Brilliant! Thanks Martin Quoting Henrique Dallazuanna : Try this: sapply(intvl.period.myrs, sum) On Tue, May 17, 2011 at 1:13 PM, Martin Hughes wrote: Dear R users I have a list, as follows: intvl.period.myrs $Devonian [1] 4.8 4.2 9.5 5.7 $Ordovician [1]  7.2  5.1 10.2  1.9

[R] adding up elements within a list

2011-05-17 Thread Martin Hughes
) summed values this is what I have so far: for (i in 1:length(names(intvl.periods.myrs)) { my.new.vector<-sum(intvl.periods.myrs[i] } This does not work and probably for obvious reasons. Thanks Martin -- Martin Hughes MPhil/PhD Research in Biology

[R] many datasets run with one R script in a computer cluster

2010-10-08 Thread Martin Hughes
) timetable<-read.table("TimeBinLookup.txt",header=T,sep="\t") PA<-as.matrix(pa[,-c(1)]) rownames(PA)<-(pa[,1]) OCHAR<-c() source("DISPARITY.R") library(calibrate) ### Thanks Martin -- Martin Hughes MPhil/PhD Research in Biology Rm 1.07, 4south Universi

[R] text/mtext axis labels on graphs

2010-10-07 Thread Martin Hughes
text to be an an angle Can anyone tell me of a way I can have both - ie text that is a specified distance from the margin AND tilted at and angle Thanks Martin -- Martin Hughes MPhil/PhD Research in Biology Rm 1.07, 4south University of Bath Department of Biology and Biochem

[R] combining collumns for data.frames

2010-09-06 Thread Martin Hughes
Hi This question is far less simple than the title suggests, please read carefully, thanks. I have 2 sets of data, both read into R >data1<-read.table ("1.txt", header=T, sep="\t") >data2<-read.table ("2.txt", header=T, sep="\t") >data1 Taxon stage1 stage2 stage3 stage4 T1 0