stat_spoke(mapping = NULL, data = NULL, geom = "segment", position = "identity", ...)
aes or aes_string. Only
needs to be set at the layer level if you are overriding
the plot defaults.layer. This can include aesthetics whose
values you want to set, not map. See layer
for more details.a data.frame with additional columns xendx position of end of line segment yendx position of end of line segment
Convert angle and radius to xend and yend.
stat_spoke understands the following aesthetics (required aesthetics are in bold):
angle
radius
x
y
xend
yend
df <- expand.grid(x = 1:10, y=1:10) df$angle <- runif(100, 0, 2*pi) df$speed <- runif(100, 0, 0.5) qplot(x, y, data=df) + stat_spoke(aes(angle=angle), radius = 0.5)
last_plot() + scale_y_reverse()
qplot(x, y, data=df) + stat_spoke(aes(angle=angle, radius=speed))