Re: [R] Creating a new table from a set of constraints

2003-08-29 Thread Roger D. Peng
I would use the subset() function. Assuming the data frame has variable names "Gender" and "Age", you could do: Y1 <- subset(X, Gender == 1 & Age >= 18 & Age <= 40) Y2 <- subset(X, Gender == 0 & Age >= 20 & Age <= 30) -roger Francisco J. Bido wrote: Hi Everyone, Here's a silly newbie question

Re: [R] Creating a new table from a set of constraints

2003-08-29 Thread Francisco J. Bido
- From: Francisco J. Bido [mailto:[EMAIL PROTECTED] Sent: Friday, 29 August 2003 4:10 PM To: [EMAIL PROTECTED] Subject: [R] Creating a new table from a set of constraints Hi Everyone, Here's a silly newbie question. How do I remove unwanted rows from an R table? Say that I read my data

RE: [R] Creating a new table from a set of constraints

2003-08-29 Thread Prof Brian Ripley
ssage- > From: Francisco J. Bido [mailto:[EMAIL PROTECTED] > Sent: Friday, 29 August 2003 4:10 PM > To: [EMAIL PROTECTED] > Subject: [R] Creating a new table from a set of constraints > > > Hi Everyone, > > Here's a silly newbie question. How do I remove unw

RE: [R] Creating a new table from a set of constraints

2003-08-29 Thread Dowkiw, Arnaud
egant, Good luck, Arnaud -Original Message- From: Francisco J. Bido [mailto:[EMAIL PROTECTED] Sent: Friday, 29 August 2003 4:10 PM To: [EMAIL PROTECTED] Subject: [R] Creating a new table from a set of constraints Hi Everyone, Here's a silly newbie question. How do I remove unwanted row

[R] Creating a new table from a set of constraints

2003-08-29 Thread Francisco J. Bido
Hi Everyone, Here's a silly newbie question. How do I remove unwanted rows from an R table? Say that I read my data as: X <- read.table("mydata.txt") and say that there are columns for age and gender. Call these X[5] and X[10], respectively. Here, X[5] is a column of positive integers and