forked from AdamWilsonLabEDU/SpatialDataScience
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPackagePresentation.Rmd
More file actions
91 lines (72 loc) · 1.7 KB
/
PackagePresentation.Rmd
File metadata and controls
91 lines (72 loc) · 1.7 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
---
title: "Package Presentation"
author: "Your Name"
output:
revealjs::revealjs_presentation:
incremental: true
theme: white
highlight: tango
self_contained: false
---
## Lead Author: Yihui Xie
Software engineer at Rstudio
PhD Department of Statistics, Iowa State University
Founded Chinese website Capital of Statistics & initiated 1st Chinese R conference
R packages:
* `animation`
* `formatR`
* `knitr`
---

> “I know I cannot eat code, so I cook almost every day to stay away from my computer for two hours.”
## Animation package
Makes animations!
* probability theory
* mathematical statistics
* multivariate statistics
* nonparametric statistics
* sampling survey
* linear models
* time series
* computational statistics
* data mining
* machine learning
**Save to Flash, GIF, HTML pages, PDF and videos**
## Basic steps…
1. Uses a ’loop’ to make a series of plots
2. Package ‘combines’ them into an animation
## Example Code: Linear Regression
```{r, results='hide'}
library(animation)
saveGIF({
ani.options(interval = 0.3, nmax = 50)
par(
mar = c(4, 4, 0.5, 0.1),
mgp = c(2, 0.5, 0),
tcl = -0.3)
least.squares()
},
img.name = "least.squares",
htmlfile = "least.squares.gif",
ani.height = 600,
ani.width = 1000,
title = "Demonstration of Least Squares")
```
```{r, results='hide'}
library(animation)
saveGIF({
ani.options(interval = 0.3, nmax = 50)
par(
mar = c(4, 4, 0.5, 0.1),
mgp = c(2, 0.5, 0),
tcl = -0.3)
least.squares()
},
img.name = "least.squares",
htmlfile = "least.squares.gif",
ani.height = 600,
ani.width = 1000,
title = "Demonstration of Least Squares")
```
---
<img src="animation.gif"></img>