You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is also possible to modify the axes labels and titles as shown in issue #16
library("vioplot")
#> Loading required package: sm#> Warning: package 'sm' was built under R version 4.1.3#> Package 'sm', version 2.2-5.7: type help(sm) for summary information#> Loading required package: zoo#> Warning: package 'zoo' was built under R version 4.1.3#> #> Attaching package: 'zoo'#> The following objects are masked from 'package:base':#> #> as.Date, as.Date.numericoutcome<- c(rnorm(25, 3, 1), rnorm(25, 2, 0.5))
intervention<- c(rep("treatment", 25), rep("control", 25))
table(intervention)
#> intervention#> control treatment #> 25 25
names(table(intervention))
#> [1] "control" "treatment"
unique(sort(intervention))
#> [1] "control" "treatment"intervention<- as.factor(intervention)
levels(intervention)
#> [1] "control" "treatment"d<-data.frame(outcome, intervention)
vioplot(outcome~intervention, data=d, xaxt='n', yaxt='n',
main="", xlab="", ylab="")
axis(side=1, at=1:length(levels(intervention)), labels= levels(intervention))
mtext("custom x labels for intervention", side=1)
mtext("custom y labels for outcome", side=2)
title(main="example with custom title", sub="subtitles are supported")
I've received several related questions which can be resolved by overlaying base R graphics and integrating vioplot with other plotting functions.
"vioplot()" functions similar to "plot()" and passes input arguments from "par()".
For example it is possible to add additional annotations. As requested by email here is an example:
Created on 2022-11-07 with reprex v2.0.2</sup](https://reprex.tidyverse.org%29%3C/sup)>
It is also possible to modify the axes labels and titles as shown in issue #16
Created on 2022-11-09 with reprex v2.0.2
I'll share these examples publicly for future reference. This issue indicates these are under consideration in updated documentation or vignettes.
The text was updated successfully, but these errors were encountered: