This seems to be an entirely new question.
The ‘plot.emmGrid()’ function returns a graphic object of class “ggplot” (by
default) or “lattice” (if called with ‘engine = “lattice”’). You should use the
provisions in those respective packages (ggplot2 or lattice) to control the
details of the plot. In the case of lattice, additional arguments are passed
via ‘...’ in the call. In the case of ggplot, one may “add” other ggplot::
functions to modify the plot.
Russ
Russell V. Lenth - Professor Emeritus
Department of Statistics and Actuarial Science
The University of Iowa - Iowa City, IA 52242 USA
Voice (319)335-0712 (Dept. office) - FAX (319)335-3017
From: Akhilesh Singh [mailto:akhileshsingh.i...@gmail.com]
Sent: Wednesday, January 10, 2018 12:45 AM
To: Sal Mangiafico <salvatore.s.mangiaf...@gmail.com>
Cc: Rolf Turner <r.tur...@auckland.ac.nz>; r-help mailing list
<r-help@r-project.org>; Lenth, Russell V <russell-le...@uiowa.edu>
Subject: Re: [R] [FORGED] Error occurring in "emmeans" package for the two data
sets I used. Please help.
Thanks for your kind reply. Problem is solved. However, it's "confidence
interval / treatment comparison plot" is not taking main title. And the fonts
of axes labels can not be changed using 'cex' parameter. I will appreciate if
you could help in this matter too.
Dr. A. K. Singh
On 09-Jan-2018 8:18 PM, "Sal Mangiafico"
<mailto:salvatore.s.mangiaf...@gmail.com> wrote:
One way to avoid this error is to create the aov without using the with
function, but instead use the data= option in the aov function.
That is,
medley2 = aov(diversity ~ zinc, data=medley.clementis)
emmeans::emmeans(medley2, "zinc")
You can see the difference in the calls:
medley2$call
medley.clementis.aov$call
This works for the other data set as well, e.g.
keough2 = aov(serpulid.ln ~ biofilm, data=keough.raimondi.ln)
~ Sal Mangiafico
On 1/8/2018 4:44 PM, Rolf Turner wrote:
On 07/01/18 02:19, Akhilesh Singh wrote:
I am a Professor of Statistics at Indira Gandhi Krishi Vishwavidyalaya,
Raipur, India. While teaching in class about analysis of variance using R,
I was doing a one-way analysis for the two data-sets given below in the
R-class. I got a typical error in "emmeans" package, please help:
Data-set-1:
--
Medley and Clements (1998) investigated the impact of zinc contamination
(and other heavy metals) on the diversity of diatom species in the USA
Rocky Mountains. The diversity of diatoms (number of species) and degree of
zinc contamination (categorized as either of high, medium, low or natural
background level) were recorded from between four and six sampling stations
within each of six streams known to be polluted, as given below:
stream=c("Eagle", "Eagle", "Eagle", "Eagle", "Blue", "Blue",
"Blue", "Blue", "Blue", "Blue", "Blue", "Snake", "Snake",
"Snake", "Snake", "Snake", "Arkan", "Arkan", "Arkan",
"Arkan", "Arkan", "Arkan", "Arkan", "Chalk", "Chalk",
"Chalk", "Chalk", "Chalk", "Splat", "Splat", "Splat",
"Splat", "Splat", "Splat")
zinc=c("BACK", "HIGH", "HIGH", "MED", "BACK", "HIGH", "BACK", "BACK",
"HIGH", "MED", "MED", "BACK", "MED", "HIGH", "HIGH", "HIGH",
"LOW", "LOW", "LOW", "LOW", "MED", "MED", "LOW", "LOW",
"HIGH", "HIGH", "MED", "LOW", "BACK", "BACK", "MED", "LOW",
"MED", "BACK")
diversity=c(2.27, 1.25, 1.15, 1.62, 1.7, 0.63, 2.05, 1.98, 1.04,
2.19, 2.1, 2.2, 2.06, 1.9, 1.88, 0.85, 1.4, 2.18, 1.83,
1.88, 2.02, 1.94, 2.1, 2.38, 1.43, 1.37, 1.75, 2.83,
1.53, 0.76, 0.8, 1.66, 0.98, 1.89)
medley.clementis=data.frame(stream,zinc,diversity)
I did the one-way anova:
---
medley.clementis.aov=with(medley.clementis, aov(diversity ~ zinc))
anova(medley.clementis)
Then, I tried to do post hoc analysis using "emmeans" package following
command:
---
emmeans::emmeans(medley.clementis.aov, "zinc")
This gives following error:
--
Error in recover_data.call(fcall, delete.response(terms(o