Description Usage Arguments Value Author(s) References See Also Examples
Easy stripchart plot with R package ggplot2
1 2 3 4 5 6 7 | ggplot2.stripchart(data, xName = NULL, yName = NULL, groupName = NULL,
position = position_jitter(0.2), addMean = FALSE, meanPointShape = 5,
meanPointSize = 4, meanPointColor = "black", meanPointFill = "blue",
addBoxplot = FALSE, boxplotFill = "white", boxplotColor = "black",
boxplotLineWeight = 0.5, groupColors = NULL, brewerPalette = NULL, ...)
ggplot2.jitter(...)
|
data |
data.frame or a numeric vector. Columns are variables and rows are observations. |
xName |
The name of column containing x variable (i.e groups). Default value is NULL. |
yName |
The name of column containing y variable. If yName=NULL, data should be a numeric vector. |
groupName |
The name of column containing group variable. This variable is used to color plot according to the group. |
position |
The position adjustment to use for overlappling points. Default value is position_jitter(0.2). |
addMean |
if TRUE, the mean point is added on the plot for each group. Default value is FALSE. |
meanPointShape |
The shape of mean point. |
meanPointSize |
The size of mean point |
meanPointColor |
Border color of the mean point. Default value is "black". |
meanPointFill |
Fill color of mean point. This parameter is used only when meanPointShape=21 to 25. Default value is "blue" |
addBoxplot |
If TRUE, boxplot is added on the dotplot. Default value is FALSE. |
boxplotFill |
Fill color of the boxplot. Default value is white. |
boxplotColor |
Boxplot line color. Default value is black. |
boxplotLineWeight |
Boxplot line weight. Default value is 0.5. |
groupColors |
Color of groups. groupColors should have the same length as groups. |
brewerPalette |
This can be also used to indicate group colors. In this case the parameter groupColors should be NULL. e.g: brewerPalette="Paired". |
... |
Other arguments passed on to ggplot2.customize custom function or to geom_dotplot functions from ggplot2 package. |
a ggplot
Alboukadel Kassambara <alboukadel.kassambara@gmail.com>
http://www.sthda.com
1 2 3 4 5 6 7 8 9 10 | df <- ToothGrowth
ggplot2.stripchart(data=df, xName='dose',yName='len',
mainTitle="Plot of length according\n to the dose",
xtitle="Dose (mg)", ytitle="Length")
#Or use this
plot<-ggplot2.stripchart(data=df, xName='dose',yName='len')
plot<-ggplot2.customize(plot, mainTitle="Plot of length according\n to the dose",
xtitle="Dose (mg)", ytitle="Length")
print(plot)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.