[R] RE: using subset

Peter Dalgaard p.dalgaard at biostat.ku.dk
Mon Dec 6 15:19:19 CET 2004


Antonio Olinto <aolinto_r at bignet.com.br> writes:

> Dear Harold, thanks for your answer.
> 
> The problem is that the levels of the factor are shown not only in the summary,
> but also when I make an interaction plot.
> 
> Is it possible to create a new subset without the reference to the levels that I
> will not use?

Just remove the levels from the factor where you don't want them:

> x1 <- dtp[dtp==0]
> x1
[1] 0 0 0 0
Levels: 0 1
> x1[drop=T]
[1] 0 0 0 0
Levels: 0


-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list