[R] Histogram plots in Lattice with spatialgrid dataframe data

Thomas Adams tea3rd at gmail.com
Sun Jul 9 17:21:13 CEST 2017

Hi all,

I can not seem to get what I want using the Lattice package to generate an
array of histograms of
spatialgrid dataframe data.

I can use the sp package and spplot to generate an array of maps that
display an array of spatialgrid dataframe data -- that's good. I have:

OHRFC Stage-3/MPE Precipitation Estimate Bias with respect to PRISM\n1997 -

Which works... I can also do histogram(ann_bias$bias1997), which works too.
I have also created a 'time-series' of boxplots successfully with these
data as well...

But if I try:


> data<-data.frame(year=c(year),bias=c(dat))
> histogram(~ bias | year, data=data)

I get a lattice plot of histograms, where the years vary, but all the
histograms are identical, which I know they should not be. It seem that all
the data from the combined spatialgrid dataframes are being used and

Obviously, I'm not constructing the data correctly. Can someone tell me
what I doing wrong. I've poured over this for a solid day, now...


	[[alternative HTML version deleted]]

More information about the R-help mailing list