[R] boxplot will remember the factor levels

Luis Ridao Cruz Luisr at frs.fo
Thu Aug 30 15:00:23 CEST 2007


I'm trying to do a simple box-and-whisker plot to some data.
The data are a subset of a large data frame
but when running the "boxplot" function on the subset data
all the factors are still present in the graph leaving a huge
empty space until the actuals factors are shown.
This produces a spurious box-and-whisker plot.

If the subset data are exported to another R session the problem is
Why are the factors still "remembered" by the boxplot?

Attached is a copy of the data.

Thanks in advance

## the line code
boxplot(mLength ~ puntar,data=test)

> version
platform       i386-pc-mingw32             
arch           i386                        
os             mingw32                     
system         i386, mingw32               
major          2                           
minor          5.1                         
year           2007                        
month          06                          
day            27                          
svn rev        42083                       
language       R                           
version.string R version 2.5.1 (2007-06-27)

More information about the R-help mailing list