--- 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)
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
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
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
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
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
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
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
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
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)
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
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
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
]
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
14 matches
Mail list logo