R User R User <ruser2008 <at> googlemail.com> writes: > I am plotting categories (X axis) and their mean count (Y axies) with > barplot(). > > The first call to barplot works fine. > > I remove records from the dataframe using final=[!final$varname == "some > value",] > > I echo the dataframe and the records are no longer in the dataframe. > > When I call plot again however, the X axis still contains the removed > category values albeit with a count of 0. > > How can I stop the removed categories appearing in the barplot? Are they > stored globally after the first barplot call? >
It has do do with non-dropped factors. See http://markmail.org/message/qdgjpuzcfia3xm6p Create a new factor with the levels dropped. Dieter ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.