Message-ID: <B63A311B-8B7F-4BFB-9900-91241B75D02C@comcast.net>
Date: 2011-01-10T01:39:21Z
From: David Winsemius
Subject: Lattice, combine histogram and line graph
In-Reply-To: <4D2A5D32.9090008@earthlink.net>
On Jan 9, 2011, at 8:13 PM, Jim Burke wrote:
> Hello everyone,
>
> I have a simple histogram of gasoline prices going back a few years
> that I want to insert a line graph of consumer price index (cpi)
> over the histogram. I have looked through the "Lattice" book by
> Deepayan Sarkar but don't see anything there. How might this be
> done? An example would be wonderful.
>
> Current code snippet follows. For example additional field to add as
> a line graph would be a cpi calculation like "gas_data$regular *
> (2010_cpi / gas_data$year )".
>
> xyplot( regular ~ as.Date(gas_data$dates,"%b %d, %Y") , data =
> gas_data,
> type = c("g", "h" ))
http://finzi.psych.upenn.edu/R/library/latticeExtra/html/doubleYScale.html
--
David Winsemius, MD
Heritage Laboratories
West Hartford, CT