abs() error in rstudio
1
0
Entering edit mode
sue • 0
@119ae0e5
Last seen 23 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 • 1.0k views
ADD COMMENT
0
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.

ADD REPLY

Login before adding your answer.

Traffic: 698 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

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

Powered by the version 2.3.6