knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
The package generates and plots random snowflakes that can be used instead of points. The snowflakes have some useful properties. Just like points in R base graphics, the snowflakes are round, no matter what aspect ratio you are using. Another nice property is that the snowflakes are scaleable: if you increase the size of the snowflake, its crystal width will increase accordingly. Most importantly, there is an infinite number of snowflake patterns that you can choose from. Each pattern is uniquely determined by a random seed. Random seeds are returned so you can reproduce the snowflakes that are your favorite. Snowflakes can be plotted using different sizes, widths, angles, and of course, colors. For more examples please see the vignette.
You can install snowflakes from github with:
# install.packages("devtools") devtools::install_github("SvetlanaEden/SNOWFLAKES")
This is a basic example which shows you how to solve a common problem:
## basic example code library('snowflakes') xCoor = seq(0, 2, .25) yCoor = (xCoor-1)^2 radius = 0.1 set.seed(1) par(mar = c(0, 0, 0, 0)) plot(xCoor, yCoor, type="l", axes = FALSE, ylab="", xlab="", ylim = range(yCoor) + radius*c(-1, 1)*0.7, xlim = range(xCoor) + radius*c(-1, 1)*0.7, col=gray(.9)) returnedSeeds = snowflakes(xCoor = xCoor, yCoor = yCoor, radius = radius, color = "#22222222")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.