star | R Documentation |
Create star plots
star(fat = 0.8, n_flairs = 5, theta = 0, plot = FALSE, add = FALSE)
fat |
A number between 0 and 1. This parameter controls the relative distance from the star's inner radius to the outer radius. Values close to 0 generate long spikes; values close to 1 generate fat spikes. |
n_flairs |
An integer. The number of spikes on the star. |
theta |
A number between 0 and 2*pi. The degree (in radians) of rotation. |
plot |
TRUE or FALSE. Should the star be plotted. |
add |
TRUE or FALSE. Should the star be added to the current plot, or should a new plot be generated. |
Inivisibly returns a list of coordinates of star spikes. Each element of the list is a spike. If plot = TRUE, then the star is plotted.
require(magrittr)
star(.8,5,pi/2, plot = TRUE)
for(k in seq(.3, .8, by = 0.01)) star(k,5,pi/2, plot = TRUE, add = TRUE)
star(.87,6,pi/2, plot = TRUE)
for(k in seq(.4, .87, by = 0.01)) star(k,6,pi/2, plot = TRUE, add = TRUE)
star(.1, 2, plot = TRUE)
for(k in 3:35) star(.1, k, plot = TRUE, add = TRUE)
star(.09, 4, plot = TRUE)
for(k in seq(.99, .01, by = -0.02)) star(k, 4, plot = TRUE, add = TRUE)
star(.99, 5, plot = TRUE)
for(k in seq(.99, .01, by = -0.02)) star(k, 5, plot = TRUE, add = TRUE)
star(.99, 6, plot = TRUE)
for(k in seq(.99, .01, by = -0.02)) star(k, 6, plot = TRUE, add = TRUE)
star(.99, 3, plot = TRUE)
for(k in seq(.99, .01, by = -0.02)) star(k, 3, plot = TRUE, add = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.