Richard,

Thanks for your quick response.  Since I also want the name of the variable in 
the histogram, I settled for below code.  Not an elegant solution, but displays 
what I want.  

reports.hist <- histogram(~ reports, data = CreditCard)
income.hist <- histogram(~ income, data = CreditCard)
share.hist <- histogram(~ share, data = CreditCard)
dependents.hist <- histogram(~ dependents, data = CreditCard)
plot(reports.hist, c(0, 0.5, 0.5, 1), more = TRUE)
plot(income.hist, c(0.5, 0.5, 1, 1), more = TRUE)
plot(share.hist, c(0, 0, 0.5, 0.5), more = TRUE)
plot(dependents.hist, c(0.5, 0, 1, 0.5), more = FALSE)

Naresh

From: Richard M. Heiberger <r...@temple.edu>
Sent: Wednesday, April 20, 2022 12:02 PM
To: Naresh Gurbuxani <naresh_gurbux...@hotmail.com>
Cc: r-help@r-project.org <r-help@R-project.org>
Subject: Re: [External] [R] A simple lattice histogram 
 
start here

 library(latticeExtra)
 c(histogram(~ card, data=CreditCard), histogram(~ reports, data=CreditCard))

then continue with

 resizePanels(c(histogram(~ card, data=CreditCard), histogram(~ reports, 
data=CreditCard), y.same=TRUE), w=c(2,16))

> On Apr 20, 2022, at 11:27, Naresh Gurbuxani <naresh_gurbux...@hotmail.com> 
> wrote:
> 
> library(lattice)
> library(AER)
> data(CreditCard)
> histogram( ~ card + reports, data = CreditCard, scales = "free")

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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