Question: filtering the rows in R
0
gravatar for ashkan
9 months ago by
ashkan90
ashkan90 wrote:

Hi Guys,

I have a .txt file in which there are 13 columns. the first one is Characters(names) and the next 12 are numbers. also there are 1000 rows. I want to filter out the rows in which even one column has the value less than 10. in other word I just need the rows with values equal or more than 10 in all columns. could you please let me know how I can do that in R?

thanks.

rna-seq R • 426 views
ADD COMMENTlink modified 9 months ago by WouterDeCoster14k • written 9 months ago by ashkan90

not a bioinformatics question: ask in stackoverflow please : http://stackoverflow.com/

ADD REPLYlink written 9 months ago by NicoBxl4.7k

While, indeed, this question isn't purely bioinformatics, it's application clearly is. I would argue the question fits here, but that's just my opinion...

ADD REPLYlink written 9 months ago by WouterDeCoster14k
3
gravatar for Devon Ryan
9 months ago by
Devon Ryan63k
Freiburg, Germany
Devon Ryan63k wrote:
d = as.data.frame(matrix(rnorm(1000, mean=20, sd=5), ncol=10))
d2 = d[which(apply(d, 1, function(x) min(x) >= 10)),]
ADD COMMENTlink written 9 months ago by Devon Ryan63k
1
gravatar for Jean-Karim Heriche
9 months ago by
EMBL Heidelberg, Germany
Jean-Karim Heriche8.8k wrote:

Not really a bioinformatics question but have you looked at subset() ?

ADD COMMENTlink written 9 months ago by Jean-Karim Heriche8.8k
0
gravatar for vchris_ngs
9 months ago by
vchris_ngs2.8k
Milan, Italy
vchris_ngs2.8k wrote:

Yes Devon is correct, since this is not a Bioinformatics question but rather on data manipulations, it is always good to expand your horizon beyond Biostars like R community help or stackoverflow. Check the link , which is a similar question like yours. The key is to subset them.

ADD COMMENTlink written 9 months ago by vchris_ngs2.8k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1000 users visited in the last hour