[R] barplot() x axes are not updated after removal of categories from the dataframe
dieter.menne at menne-biomed.de
Thu Feb 12 14:41:43 CET 2009
R User R User <ruser2008 <at> googlemail.com> writes:
> I am plotting categories (X axis) and their mean count (Y axies) with
> The first call to barplot works fine.
> I remove records from the dataframe using final=[!final$varname == "some
> 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.
Create a new factor with the levels dropped.
More information about the R-help