Re: [R] Removing Rows/Records from a Table

2006-04-17 Thread Peter Lauren
--- Marc Schwartz [EMAIL PROTECTED] wrote: On Sat, 2006-04-15 at 08:19 -0700, Peter Lauren wrote: I would like to selectively remove rows from a table. I had hoped that I could create a table and selectively add rows with something like NewTable-table(nrow=100, ncol=4)

[R] Removing Rows/Records from a Table

2006-04-15 Thread Peter Lauren
I would like to selectively remove rows from a table. I had hoped that I could create a table and selectively add rows with something like NewTable-table(nrow=100, ncol=4) NewTable[1,]-OldTable[10,] but that doesn't work. The former call gives NewTable ncol nrow 4 100 1 while the

Re: [R] Removing Rows/Records from a Table

2006-04-15 Thread Marc Schwartz
On Sat, 2006-04-15 at 08:19 -0700, Peter Lauren wrote: I would like to selectively remove rows from a table. I had hoped that I could create a table and selectively add rows with something like NewTable-table(nrow=100, ncol=4) NewTable[1,]-OldTable[10,] but that doesn't work. The

[R] Removing rows with missing values

2006-03-21 Thread Ashraf Chaudhary
Dear Colleagues: I have a question that is probably too simple but I could not get it. How to remove all the rows of a data table with missing values? Let us say my data table is 1 2 4 3 . 5 2 7 . 6 7 8 The result should be, 1 2 4 6 7 8 Thank you, Ashraf

Re: [R] Removing rows with missing values

2006-03-21 Thread Gabor Grothendieck
Check out ?na.omit ?complete.cases On 3/21/06, Ashraf Chaudhary [EMAIL PROTECTED] wrote: Dear Colleagues: I have a question that is probably too simple but I could not get it. How to remove all the rows of a data table with missing values? Let us say my data table is 1 2 4 3 . 5

[R] Removing rows with missing values

2006-03-21 Thread Ashraf Chaudhary
I got answer to my question from a previous posting on this forum. Thank you, Ashraf - [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

[R] removing ROWS with missing values

2006-03-16 Thread mark salsburg
I am trying to find out if R can recognize specific criteria for removing rows (i.e. a prexisting function) I have a matrix myMatrix that is 12000 by 20 I would like to remove rows from myMatrix that have: -999 across all columns -999 across all columns but one -999 across all columns but two

Re: [R] removing ROWS with missing values

2006-03-16 Thread Liaw, Andy
See ?complete.cases and perhaps ?na.omit. You can index the matrix by the output of complete.cases() for the first case, and feed the matrix without the omitted column to complete.cases() for the others. Andy From: mark salsburg I am trying to find out if R can recognize specific criteria

Re: [R] removing ROWS with missing values

2006-03-16 Thread plummer
Quoting mark salsburg [EMAIL PROTECTED]: I am trying to find out if R can recognize specific criteria for removing rows (i.e. a prexisting function) I have a matrix myMatrix that is 12000 by 20 I would like to remove rows from myMatrix that have: -999 across all columns -999 across all

Re: [R] removing ROWS with missing values

2006-03-16 Thread Adaikalavan Ramasamy
My answers are going to be very similar but with minor cosmetic changes that hopefully will make it bit more clearer. 1) How do you read in the data ? If you are using read.table (or read.csv, read.delim, etc) you can set na.strings=-999 to take advantage of the R's missing value features. 2)

[R] Removing Rows

2005-11-21 Thread mark salsburg
I have a data frame with the following dimensions 217 x 5 I want to create two data frames from the original. 1) One containing every tenth row of the original data frame 2) Other containing the rest of the rows. How do I do this? I've tried subset() and calling the index. thank you in

Re: [R] Removing Rows

2005-11-21 Thread Juan Pablo Romero
try this: (if d is the data.frame) 1) d[ (1:217)[1:217 %% 10 == 0], ] 2) d[ (1:217)[1:217 %% 10 != 0], ] 2005/11/21, mark salsburg [EMAIL PROTECTED]: I have a data frame with the following dimensions 217 x 5 I want to create two data frames from the original. 1) One containing every

Re: [R] Removing Rows

2005-11-21 Thread Henrik Bengtsson
seq() is good at these kind of things: keep - seq(from=1, to=nrow(d), by=10) d1 - d[ keep,] d2 - d[-keep,] /Henrik Juan Pablo Romero wrote: try this: (if d is the data.frame) 1) d[ (1:217)[1:217 %% 10 == 0], ] 2) d[ (1:217)[1:217 %% 10 != 0], ] 2005/11/21, mark salsburg

Re: [R] Removing Rows

2005-11-21 Thread Petr Pikal
] To: R-help@stat.math.ethz.ch, r-help@stat.math.ethz.ch Subject:[R] Removing Rows I have a data frame with the following dimensions 217 x 5 I want to create two data frames from the original. 1) One containing every tenth row of the original data frame 2) Other