Re: [R] How to extract or sort values from one column

2020-01-31 Thread pooja sinha
It worked, initially I made some mistake. Thanks a lot. Trying to read basics of R. Puja On Fri, Jan 31, 2020 at 1:06 PM pooja sinha wrote: > Thanks but it gives error "incorrect number of dimensions". > > > Best, > Puja > > On Fri, Jan 31, 2020 at 11:37 AM K. Elo wrote: > >> Hi! >> >> To ex

Re: [R] How to extract or sort values from one column

2020-01-31 Thread pooja sinha
Thanks but it gives error "incorrect number of dimensions". Best, Puja On Fri, Jan 31, 2020 at 11:37 AM K. Elo wrote: > Hi! > > To extract full rows, use: > > df[ ( (df$Value>=0.2 & df$Value<=0.4) | df$Value>=0.7 ), ] > > > But it is also a good idea to start reading some introductory > tutori

Re: [R] How to extract or sort values from one column

2020-01-31 Thread K. Elo
Hi! To extract full rows, use: df[ ( (df$Value>=0.2 & df$Value<=0.4) | df$Value>=0.7 ), ] But it is also a good idea to start reading some introductory tutorials. These are basic things you can find in all tutorials :-) Best, Kimmo pe, 2020-01-31 kello 10:50 -0500, pooja sinha kirjoitti: > Th

Re: [R] How to extract or sort values from one column

2020-01-31 Thread Bert Gunter
Time to study some tutorials and do your own work, don't you think? There are many good tutorials on the web. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Fr

Re: [R] How to extract or sort values from one column

2020-01-31 Thread pooja sinha
Thanks for providing the code but I also needed the output sheet in .csv format with all the four columns corresponding to the value (Chrom, Start_pos, End_pos & Value ranging from what I specified earlier). Puja On Fri, Jan 31, 2020 at 10:23 AM K. Elo wrote: > Hi! > > Oh, sorry, one "s" too mu

Re: [R] How to extract or sort values from one column

2020-01-31 Thread K. Elo
Hi! Oh, sorry, one "s" too much in my code. Here the correct one: df$Value[ (df$Value>=0.2 & df$Value<=0.4) | df$Value>=0.7 ] Best, Kimmo pe, 2020-01-31 kello 17:12 +0200, K. Elo kirjoitti: > Hi! > > Let's assume your data is stored in a data frame called 'df'. So this > code should do the job

Re: [R] How to extract or sort values from one column

2020-01-31 Thread K. Elo
Hi! Let's assume your data is stored in a data frame called 'df'. So this code should do the job: df$Value[ (df$Value>=0.2 & df$Values<=0.4) | df$Value>=0.7 ] Best, Kimmo pe, 2020-01-31 kello 09:21 -0500, pooja sinha kirjoitti: > Hi All, > > I have a .csv file with four columns (Chrom, Start

Re: [R] How to extract or sort values from one column

2020-01-31 Thread Ben Tupper
Welcome to R! You could try using findInterval() which will quickly determine into which interval your values belong. # your break points define the intervals brks <- c( 0.2, 0.4, 0.7) # make an example data frame n <- 100 x <- data.frame( x = seq_len(n), y = runif(n, min = 0, max = 1)) # c

[R] How to extract or sort values from one column

2020-01-31 Thread pooja sinha
Hi All, I have a .csv file with four columns (Chrom, Start_pos, End_pos & Value). The value column range from 0 to 1.0 having more than 2.8 million rows. I need to write a code from which I can extract the values from 0.2-0.4 & 0.7-1.0. Could anyone help me in writing the code because I am new to