Last active
December 27, 2015 06:29
-
-
Save epijim/7281405 to your computer and use it in GitHub Desktop.
Bean plot in R
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library("beanplot") | |
#To make it do the split (male/female in my plot), I set a variable up as "MainGrouping" then | |
# a space followed by BinaryGrouping encoded as a numeric value (i.e. 1 or 2). | |
beanplot(ContinuousVariable ~ MainGrouping_BinaryGrouping, data = DATA, what=c(1,1,1,0), log="", | |
ylab = "Continous variable label", side = "both", | |
border = NA, beanlinewd = 0.5, overallline = "median", | |
col = list( "brown2", "cadetblue3")) | |
legend("topright", fill = c("brown2", "cadetblue3"), c("Binary 1", "Binary 2")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment