0

I have a data matrix that contains names of samples as columns and lists of genes as rows. After transposing the matrix and calculating the z-scores using the scale() function, I transposed my matrix back.

Now I'm interested in subsetting my dataframe. So for example, if Sample 1 has rows that have values 2 standard deviations away from the mean, I would like to extract that rows and store it in a variable.

I've tried to select() my data frame however I'm getting this error message:

Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘select’ for signature ‘"matrix"

Additionally after transposing the matrix back, I'm unable to get column names.

I have also used the abs() function however it returns a TRUE and FALSE values, however I still get the same error message if I try to select columns based on if they are TRUE or not

Any help would be really appreciated

unaware
  • 1
  • 2
  • Please consider adding a reproducible example to your question to allow others to recreate your problem and propose solutions (https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – Cristian E. Nuno Oct 09 '18 at 01:14
  • 3
    Something is seriously amiss if `abs()` returns a logical value. And you should use the term transform rather than "transpose". They are not synonyms. – IRTFM Oct 09 '18 at 01:21

0 Answers0