abs() error in rstudio
Entering edit mode
sue • 0
Last seen 19 months ago
United Arab Emirates

I am trying to use the abs() function in my data. but it seems that the funtion is concidering the column names as variables, and since they are not numeric it is giving me an error. I had used the same code with another batch of data and it worked fine but i seem to be having problems now. I had updated my BiocManager package do you think that has an effect on it?

"counts is a data matrix with genes as rownames, and number id on the column name. the rest is simply numbers, with negatives and positives but they aren't integers

> AbsVal <- data.frame(abs(counts))
Error in Math.data.frame(counts) : 
  non-numeric-alike variable(s) in data frame: X14, X102, X243, X369, X370, X56, X193, X242

this is the error messege i keep receiving.

Bioconductor BiocManager abs() Bioinformatics • 850 views
Entering edit mode

try abs(data.matrix(counts))

This will solve the problem if some of your columns are character representations of numbers.

If it doesn't solve your problem you will have to tell us more about counts, perhaps the result of table(sapply(counts,class)), or str(counts) if the latter is not too voluminous.


Login before adding your answer.

Traffic: 575 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6