Re: [R] subsetting a data.frame based on a specific group of columns

2015-11-06 Thread jim holtman
I assume the solution is somewhat the same; you just have to define how to determine what the "distinctive" names are to create the groupings. My solution assumed it was the first character. If the group names end in a unique sequence, you can use this to form the groups, or you can provide a lis

Re: [R] subsetting a data.frame based on a specific group of columns

2015-11-06 Thread Boris Steipe
Please learn to use dput() to post example data. # This is your data: data <- structure(c(1232, 0, 43, 357, 71, 919, 23, 9, , 0, 811, 0, 9871, 795, 76, 72, 743, 14), .Dim = c(3L, 6L), .Dimnames = list( NULL, c("X1", "X2", "X3", "Y1", "Y2", "Y3"))) data # define groups and threshold expl

Re: [R] subsetting a data.frame based on a specific group of columns

2015-11-06 Thread Assa Yeroslaviz
sorry, for the misunderstanding. here is a more elaborate description of what i would like to achieve. I have a data set of counts from a RNA-Seq experiment and would like to filter reads with low counts. I don't want to set everything to 0 automatically. I would like to set each categorical grou

Re: [R] subsetting a data.frame based on a specific group of columns

2015-11-06 Thread jim holtman
Is this what you want: > x <- read.table(text = "X1X2X3Y1Y2Y3 + 1232357230987172 + 0719811795743 + 4391907614", header = TRUE) > x X1 X2 X3 Y1 Y2 Y3 1 1232 357 23 0 9871 72 20 719 811 795

[R] subsetting a data.frame based on a specific group of columns

2015-11-06 Thread Assa Yeroslaviz
Hi, I have a data frame with multiple columns, which are belong to several groups like that: X1X2X3Y1Y2Y3 1232357230987172 0719811795743 4391907614 I would like to filter such rows out, where the sums in one group

Re: [R] Subsetting a data.frame -> Read in with FWF format from .DAT file

2012-03-12 Thread RHelpPlease
Hi Michael, Thanks so much for your detailed reply! I gained a better understanding of the read.fwf function, along with ensuring I better note how these read-in functions convert variables, etc. As well, your tip on removing "format" while converting the PRVDR_NUM variable to numeric (from fac

Re: [R] Subsetting a data.frame -> Read in with FWF format from .DAT file

2012-03-09 Thread R. Michael Weylandt
Inline. On Fri, Mar 9, 2012 at 7:04 PM, RHelpPlease wrote: > Hi there, > I am having trouble subsetting a data frame by a conditional via one column > (of many). > > I read the file into R through "read.fwf," where I specified column widths. > Original data is .DAT.  I then utilized "names" funct

[R] Subsetting a data.frame -> Read in with FWF format from .DAT file

2012-03-09 Thread RHelpPlease
Hi there, I am having trouble subsetting a data frame by a conditional via one column (of many). I read the file into R through "read.fwf," where I specified column widths. Original data is .DAT. I then utilized "names" function to read in column headings. For one column, PRVDR_NUM, I wish to f

Re: [R] Subsetting a data.frame degenerates at one column?

2008-02-11 Thread Allen S. Rout
"jim holtman" <[EMAIL PROTECTED]> writes: > try: > input[,targets, drop=FALSE] > see: > ?"[" > for an explanation. Thanks, you who responded; this was exactly helpful, and a good reference to the part of the FM I was missing. To unpack (and demonstrate some comprehension gained.. ;) the sub

Re: [R] Subsetting a data.frame degenerates at one column?

2008-02-09 Thread Henrique Dallazuanna
Try this also: input[targets] On 08/02/2008, Allen S. Rout <[EMAIL PROTECTED]> wrote: > > Greetings. > > At the moment, I'm applying R to some AIX 'nmon' output, trying to get > a handle on some disk performance metrics. In case anyone's > interested: > > http://docs.osg.ufl.edu/tsm/pdf/ > > som

Re: [R] Subsetting a data.frame degenerates at one column?

2008-02-09 Thread John Kane
I think I understand this. Try str(input) and you will see that input$disk2 in a vector. You can force a data.frame using data.frame(input(,targets)) --- "Allen S. Rout" <[EMAIL PROTECTED]> wrote: > > Greetings. > > At the moment, I'm applying R to some AIX 'nmon' > output, trying to get >

Re: [R] Subsetting a data.frame degenerates at one column?

2008-02-08 Thread jim holtman
try: input[,targets, drop=FALSE] see: ?"[" for an explanation. On 2/8/08, Allen S. Rout <[EMAIL PROTECTED]> wrote: > > Greetings. > > At the moment, I'm applying R to some AIX 'nmon' output, trying to get > a handle on some disk performance metrics. In case anyone's > interested: > > http://

[R] Subsetting a data.frame degenerates at one column?

2008-02-08 Thread Allen S. Rout
Greetings. At the moment, I'm applying R to some AIX 'nmon' output, trying to get a handle on some disk performance metrics. In case anyone's interested: http://docs.osg.ufl.edu/tsm/pdf/ some of them are more edifying than others. (ahem) I'm trying to develop a somewhat general framework for

Re: [R] subsetting a data.frame

2007-10-10 Thread Peter Dalgaard
jim holtman wrote: > Is this what you want? > > >> x <- read.table(textConnection("Score Name >> > + 88 19_0070 > + 88 19_0070 > + 87 19_0070 > + 79 002127_0658 > + 79 002127_0658 > + 77 002127_0658"), header=TRUE)

Re: [R] subsetting a data.frame

2007-10-10 Thread jim holtman
Is this what you want? > x <- read.table(textConnection("Score Name + 88 19_0070 + 88 19_0070 + 87 19_0070 + 79 002127_0658 + 79 002127_0658 + 77 002127_0658"), header=TRUE) > # return best scores > best <- by(x, x$Name, f

[R] subsetting a data.frame

2007-10-10 Thread João Fadista
Dear all, I would like to be able to subset a data.frame in a special way. I will put here an example: Score Name 88 19_0070 88 19_0070 87 19_0070 79 002127_0658 79 002127_0658 77 002127_0658 So, for the abo