Re: [R] levels of factor when subsetting the factor

2006-09-12 Thread Sundar Dorai-Raj
er Dalgaard > Sent: Tuesday, September 12, 2006 11:45 AM > To: Afshartous, David > Cc: r-help@stat.math.ethz.ch > Subject: Re: [R] levels of factor when subsetting the factor > > "Afshartous, David" <[EMAIL PROTECTED]> writes: > >> >> All, >> >>

Re: [R] levels of factor when subsetting the factor

2006-09-12 Thread Peter Dalgaard
"Afshartous, David" <[EMAIL PROTECTED]> writes: > > All, > > When I take a subset of a factor the reduced factor still maintains all > the original levels of the factor when say forming the key in a plot. > The data is correct, but the variable still "remembers" the original > levels. See belo

Re: [R] levels of factor when subsetting the factor

2006-09-12 Thread Afshartous, David
y, September 12, 2006 11:45 AM To: Afshartous, David Cc: r-help@stat.math.ethz.ch Subject: Re: [R] levels of factor when subsetting the factor "Afshartous, David" <[EMAIL PROTECTED]> writes: > > All, > > When I take a subset of a factor the reduced factor still maintains >

Re: [R] levels of factor when subsetting the factor

2006-09-12 Thread Dimitris Rizopoulos
Web: http://med.kuleuven.be/biostat/ http://www.student.kuleuven.be/~m0390867/dimitris.htm - Original Message - From: "Afshartous, David" <[EMAIL PROTECTED]> To: Sent: Tuesday, September 12, 2006 5:22 PM Subject: [R] levels of factor when subsetting the factor > > Al

Re: [R] levels of factor when subsetting the factor

2006-09-12 Thread Doran, Harold
ber 12, 2006 11:32 AM > To: Afshartous, David; r-help@stat.math.ethz.ch > Subject: Re: [R] levels of factor when subsetting the factor > > You have at least two choices: > > R> factor(fact[1:6]) > [1] A A A B B B > Levels: A B > R> fact[1:6, drop=TRUE] &g

Re: [R] levels of factor when subsetting the factor

2006-09-12 Thread ONKELINX, Thierry
help@stat.math.ethz.ch Onderwerp: [R] levels of factor when subsetting the factor All, When I take a subset of a factor the reduced factor still maintains all the original levels of the factor when say forming the key in a plot. The data is correct, but the variable still "remembers" the

Re: [R] levels of factor when subsetting the factor

2006-09-12 Thread Roger D. Peng
I think you want 'fact[1:6, drop = TRUE]' -roger Afshartous, David wrote: > > All, > > When I take a subset of a factor the reduced factor still maintains all > the original levels of the factor when say forming the key in a plot. > The data is correct, but the variable still "remembers" the o

Re: [R] levels of factor when subsetting the factor

2006-09-12 Thread Douglas Bates
On 9/12/06, Afshartous, David <[EMAIL PROTECTED]> wrote: > > All, > > When I take a subset of a factor the reduced factor still maintains all > the original levels of the factor when say forming the key in a plot. > The data is correct, but the variable still "remembers" the original > levels. See

Re: [R] levels of factor when subsetting the factor

2006-09-12 Thread Liaw, Andy
You have at least two choices: R> factor(fact[1:6]) [1] A A A B B B Levels: A B R> fact[1:6, drop=TRUE] [1] A A A B B B Levels: A B HTH, Andy From: Afshartous, David > > All, > > When I take a subset of a factor the reduced factor still > maintains all > the original levels of the factor wh

Re: [R] levels of factor when subsetting the factor

2006-09-12 Thread David Barron
Try > new.fact = fact[1:6, drop=TRUE] On 12/09/06, Afshartous, David <[EMAIL PROTECTED]> wrote: > > All, > > When I take a subset of a factor the reduced factor still maintains all > the original levels of the factor when say forming the key in a plot. > The data is correct, but the variable st

Re: [R] levels of factor when subsetting the factor

2006-09-12 Thread Doran, Harold
23 AM > To: r-help@stat.math.ethz.ch > Subject: [R] levels of factor when subsetting the factor > > > All, > > When I take a subset of a factor the reduced factor still > maintains all the original levels of the factor when say > forming the key in a plot. > The data is

[R] levels of factor when subsetting the factor

2006-09-12 Thread Afshartous, David
All, When I take a subset of a factor the reduced factor still maintains all the original levels of the factor when say forming the key in a plot. The data is correct, but the variable still "remembers" the original levels. See below for reproducible code. Does anyone know how to fix this? che