[R] lattice: histogram of factor variable

Deepayan Sarkar deepayan.sarkar at gmail.com
Fri Nov 10 22:10:57 CET 2006


On 11/10/06, Albrecht, Dr. Stefan (AZ Private Equity Partner)
<stefan.albrecht at apep.com> wrote:
> Dear all,
>
> I am encountering a problem with lattice in the current version 0.14-13
> with R version 2.4.0 on a Windows XP system.
> For example,
>
> histogram(~voice.part, singer)
>
> is not labeling the x labels according to the factor levels of
> voice.part, which it should do (and has done in former versions of
> lattice, as far as I remember).

I will fix that, but you shouldn't really be using histograms for
factors. Use barchart instead, e.g.

barchart(table(voice.part) ~ levels(voice.part), singer, origin = 0)

-Deepayan

> In addition, I get the warnings
> Warning messages:
> 1: arguments 'include.lowest', 'right' are not made use of in:
> hist.default(x, breaks = breaks, plot = FALSE, include.lowest =
> include.lowest,
> 2: arguments 'include.lowest', 'right' are not made use of in:
> hist.default(x, breaks = breaks, plot = FALSE, include.lowest =
> include.lowest,
> >
>
> which are a bit annoying, but (hopefully) not a real problem.
>
> Does anybody have a simple help (for the x labels)?
>
> Many thanks and best regards,
>
> Stefan
>
> ____________________________________
> Dr. Stefan Albrecht, CFA
> Allianz Private Equity Partners GmbH
> Giselastr. 4 | 80802 Munich | Germany
>
> Phone: +49.(0)89.3800.18317
> Fax: +49.(0)89.3800.818317
> EMail: stefan.albrecht at apep.com <mailto:stefan.albrecht at apep.com>
> Web: www.apep.com <http://www.apep.com/>
>
>
> Please note my new email address:
> stefan.albrecht at apep.com <mailto:stefan.albrecht at apep.com>
>
>
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>


-- 
http://www.stat.wisc.edu/~deepayan/



More information about the R-help mailing list