-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
66 lines (48 loc) · 1.26 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# twinkle
Motivated by [\@ikashnitsky](https://twitter.com/ikashnitsky), who [shared the snowflakes](https://twitter.com/ikashnitsky/status/937786580231696384) he made for his 3yo daughter, I created this R package that does something similar with one of Mateo's, my 2yo, favorite things, stars :).
# Install
To install it you can use `devtools`
```r
devtools::install_github("gvegayon/twinkle")
```
## Example
This is a basic example which shows you how to solve a common problem: drawing a sky full of stars
```{r default}
library(twinkle)
set.seed(1)
twinkle()
```
If you don't like the tails, then set `tail = 1`
```{r no-tail}
set.seed(1)
twinkle(tail = 1)
```
If You want to get more _curvy_ tails, just change the `deg_to` option
```{r deg}
set.seed(1)
twinkle(deg_to = pi, deg_from = 0)
```
You can also play with the colors
```{r col}
set.seed(1)
twinkle(
tail = 300,
col_decay_rate = 5,
deg_to = pi/2,
deg_from = -pi,
bg = blues9[6],
cols = c("lightyellow", "steelblue", "lightblue")
)
```