Re: [R] drop levels problem

2010-11-29 Thread Joshua Wiley
Just to follow up on my own post a bit: xmelt$year[xmelt$year == "first", drop = TRUE] will do what you want. I think because in the subset there are multiple columns not all of which are factor, the method for '[' being used is not the factor one that would drop unused levels. I did not make t

Re: [R] drop levels problem

2010-11-29 Thread Felipe Carrillo
thz.ch > Sent: Mon, November 29, 2010 11:18:45 AM > Subject: Re: [R] drop levels problem > > Hi Felipe, > > On Mon, Nov 29, 2010 at 11:01 AM, Felipe Carrillo > wrote: > > Hi all: > > I am having trouble dropping levels, got a few hints online without success. >

Re: [R] drop levels problem

2010-11-29 Thread Henrique Dallazuanna
Take a look on droplevels function (R >= 2.12) On Mon, Nov 29, 2010 at 5:01 PM, Felipe Carrillo wrote: > Hi all: > I am having trouble dropping levels, got a few hints online without > success. > Please consider the dataset below: > I was under the inpression that subset(..drop=TRUE) would w

Re: [R] drop levels problem

2010-11-29 Thread Joshua Wiley
Hi Felipe, On Mon, Nov 29, 2010 at 11:01 AM, Felipe Carrillo wrote: > Hi all: > I am having trouble dropping levels, got a few hints online without success. > Please consider the dataset below: >  I was under the inpression that subset(..drop=TRUE) would work but it > doesn't Here drop is re

[R] drop levels problem

2010-11-29 Thread Felipe Carrillo
Hi all: I am having trouble dropping levels, got a few hints online without success. Please consider the dataset below:  I was under the inpression that subset(..drop=TRUE) would work but it doesn't library(ggplot2)     library(hmisc) x <- structure(list(first = c(38.2086, 43.1768, 43.146, 4