Skip to content
Back to formatted view

Raw Message

Message-ID: <BN7PR08MB41145D152D9530A4A7B4AD63D08E9@BN7PR08MB4114.namprd08.prod.outlook.com>
Date: 2021-02-09T16:35:03Z
From: David Winsemius
Subject: Need help using lattice
In-Reply-To: <feb489da-1b53-5eeb-d03f-e21c54a1aaad@xs4all.nl>

Thank you.

From: Gerrit Draisma <gdraisma at xs4all.nl>
Date: Tuesday, February 9, 2021 at 6:14 AM
To: Parkhurst, David F. <parkhurs at indiana.edu>
Cc: r-help at r-project.org <r-help at r-project.org>
Subject: Re: [R] Need help using lattice
Ha David,
Thanks for your reply.
For your last question, you have to change month into an ordered factor
variable:

library(lattice)
df <- expand.grid(site=c("een","twee","drie","vier","vijf"),
                  month=factor(3:12,levels=1:12,
                               labels=month.abb, ordered=TRUE))
df$conc <- rnorm(dim(df)[1])
dotplot(month~conc|site,data=df)

HTH, Gerrit



Op 08-02-2021 om 21:04 schreef Parkhurst, David F.:
> That worked nicely;  thanks again.  Here?s what I used for our data:
>
> library(lattice)
>
> df <-
> expand.grid(site=c("CrCr","NFSC","MFSC","SFSC","LMO","MCE","MUE","MLE","MoCe"),months=1:9)
>
> dotplot(months~conc | site, data=df)
>
> The result is attached.  Is there a way to replace the month numbers on
> the y axes with the names Apr-Dec?
>
> David
>

	[[alternative HTML version deleted]]