Plotting the multiple comparison of means

Hello!

I am trying to use the function "plot" in agricolae package. I used it a while ago and it gave me good results. Now it gaves the warning "In plot.group(out, xlab = "x... y...)", :
NAs introduced by coercion"
The result is a plot with no actual bars or boxes, just letters. I tried it with the example code and gave me the same result.

Basically I try to analyze my data with anova, then apply post-hoc test and simplyl visualize the results e.g. in a boxplot or barchart, without apllying the letters manually on top of each treatment. Something shown here, but it worked with simpler code earlier (plus that code does not work for me).
Let's say I try to use the LSD.test function with code given in the help.

library(agricolae)
data(sweetpotato)
model<-aov(yield~virus, data=sweetpotato)
out <- LSD.test(model,"virus", p.adj="bonferroni")
#stargraph
# Variation range: max and min
plot(out)
#endgraph
# Old version LSD.test()
df<-df.residual(model)
MSerror<-deviance(model)/df
out <- with(sweetpotato,LSD.test(yield,virus,df,MSerror))
#stargraph
# Variation interquartil range: Q75 and Q25
plot(out,variation="IQR")
#endgraph
out<-LSD.test(model,"virus",p.adj="hommel",console=TRUE)
plot(out,variation="SD") # variation standard deviation

And it gives no actual plots either. I feel puzzled and a bit helpless at the moment.
If anyone could help me out it would be much appreciated!

Dome

Please attach your sessionInfo() and any error messages in full

library(agricolae)
data(sweetpotato)
model<-aov(yield~virus, data=sweetpotato)
out <- LSD.test(model,"virus", p.adj="bonferroni")
#stargraph
# Variation range: max and min
plot(out)

#endgraph
# Old version LSD.test()
df<-df.residual(model)
MSerror<-deviance(model)/df
out <- with(sweetpotato,LSD.test(yield,virus,df,MSerror))
#stargraph
# Variation interquartil range: Q75 and Q25
plot(out,variation="IQR")

#endgraph
out<-LSD.test(model,"virus",p.adj="hommel",console=TRUE)
#> 
#> Study: model ~ "virus"
#> 
#> LSD t Test for yield 
#> P value adjustment method: hommel 
#> 
#> Mean Square Error:  22.48917 
#> 
#> virus,  means and individual ( 95 %) CI
#> 
#>       yield      std r       LCL      UCL  Min  Max
#> cc 24.40000 3.609709 3 18.086268 30.71373 21.7 28.5
#> fc 12.86667 2.159475 3  6.552935 19.18040 10.6 14.9
#> ff 36.33333 7.333030 3 30.019601 42.64707 28.0 41.8
#> oo 36.90000 4.300000 3 30.586268 43.21373 32.1 40.4
#> 
#> Alpha: 0.05 ; DF Error: 8
#> Critical Value of t: 2.306004 
#> 
#> Minimum Significant Difference: 8.928965 
#> 
#> Treatments with the same letter are not significantly different.
#> 
#>       yield groups
#> oo 36.90000      a
#> ff 36.33333      a
#> cc 24.40000      b
#> fc 12.86667      c
plot(out,variation="SD") # variation standard deviation

Created on 2020-09-30 by the reprex package (v0.3.0.9001)

Thank you for your response!

Here are the warning messages:

plot(out)
Warning message:
In plot.group(out) : NAs introduced by coercion

plot(out,variation="IQR")
Warning message:
In plot.group(out, variation = "IQR") : NAs introduced by coercion

plot(out,variation="SD") # variation standard deviation
Warning message:
In plot.group(out, variation = "SD") : NAs introduced by coercion

So basically it seems that there are issues around running the plot function and with the datatype.

And last this is what sessionInfo() gives back:

sessionInfo()
R version 4.0.0 (2020-04-24)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)

Matrix products: default

locale:
[1] LC_COLLATE=Hungarian_Hungary.1250
[2] LC_CTYPE=Hungarian_Hungary.1250
[3] LC_MONETARY=Hungarian_Hungary.1250
[4] LC_NUMERIC=C
[5] LC_TIME=Hungarian_Hungary.1250

attached base packages:
[1] stats graphics grDevices utils datasets
[6] methods base

other attached packages:
[1] agricolae_1.3-2

loaded via a namespace (and not attached):
[1] Rcpp_1.0.4.6 compiler_4.0.0 pillar_1.4.4
[4] later_1.0.0 questionr_0.7.1 highr_0.8
[7] forcats_0.5.0 tools_4.0.0 digest_0.6.25
[10] lattice_0.20-41 nlme_3.1-147 lifecycle_0.2.0
[13] tibble_3.0.1 pkgconfig_2.0.3 rlang_0.4.6
[16] shiny_1.4.0.2 rstudioapi_0.11 haven_2.3.0
[19] fastmap_1.0.1 cluster_2.1.0 dplyr_1.0.0
[22] generics_0.0.2 vctrs_0.3.0 hms_0.5.3
[25] grid_4.0.0 combinat_0.0-8 tidyselect_1.1.0
[28] glue_1.4.1 R6_2.4.1 klaR_0.6-15
[31] purrr_0.3.4 magrittr_1.5 promises_1.1.0
[34] htmltools_0.4.0 ellipsis_0.3.1 MASS_7.3-51.5
[37] labelled_2.4.0 mime_0.9 xtable_1.8-4
[40] httpuv_1.5.3.1 miniUI_0.1.1.1 AlgDesign_1.2.0
[43] crayon_1.3.4

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.