Displaying 1 result from an estimated 1 matches for "cem1_parti".
Did you mean:
cem1_partial
2010 Dec 27
1
matrix looping accessing previous column
...t;down" cells are converted to 'NA'.
A sample of my data matrix and code are pasted below. Any suggestions would
be appreciated. Thanks!
Data:
PROBE 1 2.5 UP
PROBE 2 1 UP
PROBE 3 1.4 DOWN
PROBE 4 2.0 UP
PROBE 5 1.3 DOWN
#TAKE PART OF MATRIX
CEM1_PARTIAL <- CEM1[1:3,1:5]
for(j in 1:ncol(CEM1_PARTIAL))
{
for(i in 1:nrow(CEM1_PARTIAL))
{
if(CEM1_PARTIAL[i,j] == "down")
{CEM1_PARTIAL[i,j-1]= CEM1_PARTIAL[i,j-1] * -1;}
}
}
error:
Warning messages:
1: In Ops.factor(CEM1_PARTIAL[i, j - 1], -1) :
* not meaningfu...