abs() error in rstudio
1
0
Entering edit mode
sue • 0
@119ae0e5
Last seen 6 weeks 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 • 107 views
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.