This is a test version of Biostars. For the public version, visit https://www.biostars.org.
what does this error mean please?

Hi,

I have a matrix,

head(MATRS[1:2,1:2])
     GENES_COL         COUNTS_COL
[1,] " oId CUFF.103.1" "1"       
[2,] " oId CUFF.119.1" "1"       

MATRS <- cbind(GENES_COL, COUNTS_COL)
#Create matrix that contains an ORF for each row and for each column that contains the count of reads that are in a window of n nucleotides
n=binwidth
MATRS_new_1 <- matrix(nrow=length(GENES_COL), ncol=(as.integer(max(geneslength)/n)+1))
#

Error in Summary.factor(c(1368L, 115L, 53L, 1135L, 1317L, 776L, 593L,  : 
  'max' not meaningful for factors

How I can fix this error please?

r

1 answer

The error message means you're applying max() to something that, although it may look numeric, is a factor. To fix, convert to numeric.

Log in to answer this question.