ez.piechart | R Documentation |
pie chart
ez.piechart(
df,
cmd,
start = 0,
direction = 1,
color = "color",
colors = ez.palette("Zhu"),
alpha = 1,
n.size = 5.5,
n.type = 3,
n.angle = 0,
ylab = "",
xlab = "",
zlab = NULL,
legend.position = "top",
legend.direction = "horizontal",
legend.box = T,
legend.size = c(0, 10),
xangle = 0,
vjust = NULL,
hjust = NULL,
theme.apa = TRUE
)
df |
data frame in long format (but be careful that standard error might be inaccurate depending on grouping in the long format)
|
cmd |
a single col name |
start |
offset of starting point from 12 o'clock in radians eg, pi/3 |
direction |
1, clockwise; -1, anticlockwise |
color |
"bw" or "color" black/white or colorblind-friendly color |
alpha |
pie alpha value |
n.size |
set to 0 to hide count/percentage |
n.type |
1 = pct; 2 = n; 3 = pct (n); 4 = n (pct) |
n.angle |
0, 45, 90, 180, 270 |
ylab |
y label |
xlab |
x label |
zlab |
z/a/fill/legend label, only applicable when there is z provided NULL |
legend.position |
legend position 'top', 'bottom', 'left', 'right', 'none', c(x,y,two-element numeric vector)
|
legend.direction |
horizontal or vertical |
legend.box |
box of legend, T or F |
legend.size |
c(0,10) the first number 0 controls the legend title, 0=hide; the second number controls legend.key.size, legend.text |
xangle |
angle of x text 0 |
vjust |
vjust of x text NULL |
hjust |
hjust of x text NULL |
a ggplot object (+theme_apa() to get apa format plot), +scale_y_continuous(limits=c(-5,8),breaks=seq(-5,8,by=2),oob=scales::rescale_none)
see http://stackoverflow.com/a/31437048/2292993 for discussion
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.