View source: R/side_functions.R
violinPlots | R Documentation |
Return violin plots to compare the distribution of each variable for each group.
violinPlots(data, groups)
data |
A dataframe with numeric columns |
groups |
A vector indicating the group of each observation |
A list of plots created with ggplot2
## Not run:
data(LyonIris)
AnalysisFields <-c("Lden","NO2","PM25","VegHautPrt","Pct0_14","Pct_65","Pct_Img",
"TxChom1564","Pct_brevet","NivVieMed")
dataset <- sf::st_drop_geometrie(LyonIris[AnalysisFields])
queen <- spdep::poly2nb(LyonIris,queen=TRUE)
Wqueen <- spdep::nb2listw(queen,style="W")
result <- SFCMeans(dataset, Wqueen,k = 5, m = 1.5, alpha = 1.5, standardize = TRUE)
violinPlots(dataset, result$Groups)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.