search for: ncol1

Displaying 2 results from an estimated 2 matches for "ncol1".

Did you mean: col1
2003 May 01
2
What' wrong?
...y R script: library("ctest") catSignifTest <- function( catFile ) { ############################################################### ## Get the data sets from text file catData <- read.table( catFile ) ncols <- length(catData) nrows <- length(catData[,1]) ncol1 <- ncols - 1 probeNbr <- catData[1,] Achip <- catData[,ncols] for ( row in 2:nrows ) { prob <- Achip[ row ] / Achip[ 1 ] if ( prob <= 0 ) prob <- 0.0000001 if ( prob >= 1 ) prob <- 0.9999999 chip <- catData[row,] for ( col in 1:ncol1 ) {...
2003 Oct 31
2
Summing elements in a list
...ces where each matrix in the result is the weighted sum of the corresponding matrices. I could use a loop but this is a nested calculation so I was hoping there is a more efficient way to do this. To help clarify, here is the code I would use with a for loop result <- list(mat1=matrix(0,nrow1,ncol1), mat2=matrix(0,nrow2,ncol2)) for (i in seq(along=matlist)) { result$mat1 <- result$mat1+w[i]*matlist[[i]]$mat1 result$mat2 <- result$mat2+w[i]*matlist[[i]]$mat2 } I apologise if this is a trivial question. Unfortunately I don't have my copy of V&R S Programming...