[R] assigning 'default' values

2010-02-01 Thread Richard Thompson
Hi all, probably something really simple, that I've missed but I'm running this loop in my Rscript: code for (i in 1:nrow(cells)){ if(plate == as.character(cells[i,1])){ plate2 -cells[i,2]} } code it's assigning the relevant data correctly as long as plate exists somewhere in

Re: [R] incorrect multiple outputs

2009-12-11 Thread Richard Thompson
Ista, Here is the full code: file-read.table(file=input_file.txt,sep=\t)[,c(1,3:5)] file.rows- c(nrow(file)/288) full.array - array(0,dim=c(8,file.rows,12)) cellnames - rep(A,file.rows) barcodes - rep(A,file.rows) t - rep(A,file.rows) t11 - rep(A,file.rows) cv - rep(A,file.rows) for (k in

Re: [R] incorrect multiple outputs

2009-12-11 Thread Richard Thompson
*m; x.nodrug2[(z-2):z,1:3]-as.matrix(x[(p-2):p,2:4]) }; if (n==12){ z-3*m; x.nodrug2[(z-2):z,4:6]-as.matrix(x[(p-2):p,2:4]) } } } Richard 2009/12/11 Richard Thompson bawa...@googlemail.com Ista, Here is the full code: file-read.table(file=input_file.txt,sep