Filter values in data frame

后端 未结 1 1326
感情败类
感情败类 2020-12-21 21:35

Basically, I have a gene dataset in which the rows are genes and columns are sequential time points of protein folding. I need a function to filter genes of a certain thresh

相关标签:
1条回答
  • 2020-12-21 22:10

    R is vectorized and R recycles. That means, that generally, something as simple as myDF > threshold will get you awfully close to what you need.

    Specifically, it will give you a logical matrix of the same dimensions as your data.frame which will be TRUE when that cell in the DF exceeds the threshold (and FALSE otherwise).

    You can then use that matrix as your tool to subset the data.frame.

    myDF[myDF > threshold]  
    
    0 讨论(0)
提交回复
热议问题