hi,
 
library(lattice)
x<-c(-1,-1,-1,0,0,0,0,1,1,2)
rng<-range(x)
histogram(x,endpoints=c(rng[1]-0.5,rng[2]+0.5),nint=length(unique(x)))
 
instead of contiguous bins, i'd like spaces between them to indicate
that the data is discrete, or even better, line segments positioned at
integer values.
i know how to do this with plot, but i need it with histogram, so that
in more complicated contexts i can use histogram(~x| f1 * f2....)
 
thanks!
 
 

        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to