Displaying 2 results from an estimated 2 matches for "tmpmatrix".
2009 May 14
3
memory usage grows too fast
...n pattern. For example, a toy dataset is as follows.
Col1 Col2 Col3 Col4
01 02 02 00 => Freq of ?02? is 0.5
02 02 02 01 => Freq of ?02? is 0.75
00 02 01 01 ?
My code is quite simple as the following to find the pattern ?02?.
OccurrenceRate_Fun<-function(dataMatrix)
{
tmp<-NULL
tmpMatrix<-apply(dataMatrix,1,match,"02")
for ( i in 1: ncol(tmpMatrix))
{
tmpRate<-table(tmpMatrix[,i])[[1]]/ nrow(tmpMatrix)
tmp<-c(tmp,tmpHET)
}
rm(tmpMatrix)
rm(tmpRate)
return(tmp)
gc()
}
The problem is the memory usage grows very fast and hard to be handled on...
2004 Apr 22
3
fill up a matrix
Hi all,
I want to fill in this matrix vectors (by column) without overwriting the first elements in column 1995.
Is there any other way than concatenate the first element with the vector and then assign this new vector
to the column in matrix?
matrix[,"3"]<-c(1591,"vector")
matrix[,"4"]<-c(405,"vector")
...
...