I am trying to write a script that plots violin plot without explicitly describing the levels of the plot. lets say: x1=c(x11,x22,....,x1n), x2=c(x21,x22,...,x2m), ... xp=(xl1,....,xlj)
. If I had the number of levels in advance I could have enterend: violin(x1,x2,...,xp)
. However, I can't (the number of levels (p) is defined is a variable). I am tried to put it in datastrucre (x=list(x1,x2,...xp)
and than do violin(x)
. But it did not work. is there someway else to put the vector in some data structure that could be passed to violin()
.
Thank you
Asked
Active
Viewed 87 times
-1

user552231
- 1,095
- 3
- 21
- 40
-
It's not clear what your problem is nor what package `violin()` is from. Please post a reproducible example. – RoyalTS Mar 18 '17 at 18:48
-
That said, `ggplot2`'s `geom_violin()` might be worth looking at. – RoyalTS Mar 18 '17 at 18:48
-
Are your variables in a useful structure like a list? Because `do.call(what = violin, args = list_of_x)` seems to be what you want. – Gregor Thomas Mar 18 '17 at 18:53