-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
718 lines (511 loc) · 21.2 KB
/
index.html
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
<!DOCTYPE html>
<html lang="" xml:lang="">
<head>
<title>{flexdashboards}</title>
<meta charset="utf-8" />
<meta name="author" content="Akhila Nekkanti" />
<script src="libs/htmlwidgets-1.5.3/htmlwidgets.js"></script>
<script src="libs/plotly-binding-4.9.3/plotly.js"></script>
<script src="libs/typedarray-0.1/typedarray.min.js"></script>
<script src="libs/jquery-1.11.3/jquery.min.js"></script>
<link href="libs/crosstalk-1.0.0/css/crosstalk.css" rel="stylesheet" />
<script src="libs/crosstalk-1.0.0/js/crosstalk.min.js"></script>
<link href="libs/plotly-htmlwidgets-css-1.57.1/plotly-htmlwidgets.css" rel="stylesheet" />
<script src="libs/plotly-main-1.57.1/plotly-latest.min.js"></script>
<script src="libs/core-js-2.5.3/shim.min.js"></script>
<script src="libs/react-16.12.0/react.min.js"></script>
<script src="libs/react-16.12.0/react-dom.min.js"></script>
<script src="libs/reactwidget-1.0.0/react-tools.js"></script>
<script src="libs/reactable-binding-0.1.0/reactable.js"></script>
<link rel="stylesheet" href="xaringan-themer.css" type="text/css" />
</head>
<body>
<textarea id="source">
class: center, middle, inverse, title-slide
# {flexdashboards}
## Data visuals. On a board.
### Akhila Nekkanti
### Winter 2021
---
class: center, left
#Why use a dashboard?
https://ramikrispin.github.io/coronavirus_dashboard/
![](img/covid19.PNG)
---
#Why use a dashboard?
http://jkunst.com/flexdashboard-highcharter-examples/pokemon/
![](img/pokemon.PNG)
---
#Why use a dashboard?
https://jim-wright90.github.io/data_sci_capstone_project/
![](img/jim.PNG)
---
#Why use a dashboard?
https://github.com/akhilanekkanti1/FlexDashboards
![](img/akhila.PNG)
---
# The ultimate source
https://rmarkdown.rstudio.com/flexdashboard/
![](img/flexdash.PNG)
---
#Where to start?
--
Workflow!
--
We want to make sure we have the *option* to make our dashboard public.
--
1. Create a new Project
--
2. Create a new Rmarkdown from template {flexdashboards}
--
3. Knit right away
--
4. Create a github Repo
--
5. Link your local and remote repos with GitKraken
---
#Mise en place: Set yourself up.
--
Open:
- R
- GitKraken
- Github
---
class: center, middle
##1. Create a new Project
File > New Project > New Directory
![](img/newproj.gif)
---
class: center, middle
##2. Create a new Rmarkdown from template and (#3) Knit
```r
#One time only
install.packages("flexdashboard")
```
![](img/newrmd.gif)
---
class: center, middle
##4. Create a GitHub repo and (#5) Link it with your local
![](img/link.gif)
---
class: center, middle
# Ready to PUBLISH!
![](img/publish.gif)
---
class: center, middle
## Now let's play around with our dashboard!
---
## Let's start with the YAML.
```r
---
title: "Coolest DEMO EVER"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
* social: menu
* source_code: https://github.com/akhilanekkanti1/dashboard_demo
---
```
![](img/source.PNG)
---
## Let's add a new page.
```r
*Weird Flex
*=========================
Column {data-width=650}
-----------------------------------------------------------------------
### Chart A
< r code chunk >
Column {data-width=350}
-----------------------------------------------------------------------
### Chart B
< r code chunk >
*But Okay
*========================
### Chart C
< r code chunk >
```
![](img/tabs.PNG)
---
##Play around!
- Change the name of each square
- Try adding a different plot in each square
- Can you change the number of squares in each page?
- Can you change the size of each square?
Plot example:
```r
library(tidyverse)
mtcars %>%
ggplot(aes(wt, mpg, col=as_factor(cyl))) +
geom_point() +
facet_grid(~cyl)
```
## 5 minutes :)
---
##Want to add some text?
Just add it in like you would for a typical Rmarkdown doc.
```r
# Page 1
Check out this plot I made.
### Plot A
<R code for your plot>
```
---
##Columns
- Create a new column with
```{}
Column
--------------------------------------
```
- Change the width of each column
- Notice there are NO spaces around the '='
```{}
Column {data-width=400}
--------------------------------------
```
- Add a new square within each column
```{}
Column {data-width=400}
--------------------------------------
### New Square
```
---
##Columns vs. Rows
- If you want all rows:
```r
---
title: "Coolest DEMO EVER"
output:
flexdashboard::flex_dashboard:
* orientation: rows
vertical_layout: fill
social: menu
source_code: https://github.com/akhilanekkanti1/dashboard_demo
---
```
---
##Columns vs. Rows
- If you want rows for some pages and columns for other pages:
- don't specify the orientation
- **do** add 'data-orientation' when you name your pages.
In this example, Page 1 will have rows and Page 2 will have columns.
```r
#change your yaml
---
title: "Coolest DEMO EVER"
output:
flexdashboard::flex_dashboard:
* vertical_layout: fill
* horizontal_layout: fill
social: menu
source_code: https://github.com/akhilanekkanti1/dashboard_demo
---
*Page 1 {data-orientation=rows}
*===============================
*Page 2
*===============================
```
---
##Rows
- Create a new row with
```{}
Row
--------------------------------------
```
- Change the width of each row
- Notice there are NO spaces around the '='
```{}
Row {data-height=400}
--------------------------------------
```
- Add a new square within each row
```{}
Row {data-height=400}
--------------------------------------
### New Square
```
---
# You can also add a sidebar!
Here's an example from my dashboard.
![](img/akhila.PNG)
---
# You can also add a sidebar!
If you want the sidebar on all pages:
```{}
Sidebar Title {.sidebar}
===================================
This Dashboard is Important.
RMarkdown syntax works here!
[Click here](https://youtu.be/dQw4w9WgXcQ).
```
If you want the sidebar on just one page:
```{}
Sidebar Title {.sidebar}
------------------------------
```
---
#What if you want to organize your columns even more?
You can use tabs:
![](img/minitabs_LI.jpg)
---
## Use tabset to split your columns or rows into tabs.
```r
*Column {.tabset}
-------------------------------------
*### Part 1
<r code chunk>
*### Part 2
<r code chunk>
Column {data-width=650}
-----------------------------------------------------------------------
### OH la la, Final Plot
```
**For multiple arguments, there's no comma in between.**
```{}
Column {.tabset data-width=350}
-------------------------------------
```
---
#Interactivity!
You can use {reactable} or {plotly} to make your tables or plots interactive!
Here's a simple example:
```r
p <- mtcars %>%
ggplot(aes(wt, mpg)) +
geom_point()
plotly::ggplotly(p)
```
<div id="htmlwidget-0bf04c51ada9bf88b752" style="width:504px;height:504px;" class="plotly html-widget"></div>
<script type="application/json" data-for="htmlwidget-0bf04c51ada9bf88b752">{"x":{"data":[{"x":[2.62,2.875,2.32,3.215,3.44,3.46,3.57,3.19,3.15,3.44,3.44,4.07,3.73,3.78,5.25,5.424,5.345,2.2,1.615,1.835,2.465,3.52,3.435,3.84,3.845,1.935,2.14,1.513,3.17,2.77,3.57,2.78],"y":[21,21,22.8,21.4,18.7,18.1,14.3,24.4,22.8,19.2,17.8,16.4,17.3,15.2,10.4,10.4,14.7,32.4,30.4,33.9,21.5,15.5,15.2,13.3,19.2,27.3,26,30.4,15.8,19.7,15,21.4],"text":["wt: 2.620<br />mpg: 21.0","wt: 2.875<br />mpg: 21.0","wt: 2.320<br />mpg: 22.8","wt: 3.215<br />mpg: 21.4","wt: 3.440<br />mpg: 18.7","wt: 3.460<br />mpg: 18.1","wt: 3.570<br />mpg: 14.3","wt: 3.190<br />mpg: 24.4","wt: 3.150<br />mpg: 22.8","wt: 3.440<br />mpg: 19.2","wt: 3.440<br />mpg: 17.8","wt: 4.070<br />mpg: 16.4","wt: 3.730<br />mpg: 17.3","wt: 3.780<br />mpg: 15.2","wt: 5.250<br />mpg: 10.4","wt: 5.424<br />mpg: 10.4","wt: 5.345<br />mpg: 14.7","wt: 2.200<br />mpg: 32.4","wt: 1.615<br />mpg: 30.4","wt: 1.835<br />mpg: 33.9","wt: 2.465<br />mpg: 21.5","wt: 3.520<br />mpg: 15.5","wt: 3.435<br />mpg: 15.2","wt: 3.840<br />mpg: 13.3","wt: 3.845<br />mpg: 19.2","wt: 1.935<br />mpg: 27.3","wt: 2.140<br />mpg: 26.0","wt: 1.513<br />mpg: 30.4","wt: 3.170<br />mpg: 15.8","wt: 2.770<br />mpg: 19.7","wt: 3.570<br />mpg: 15.0","wt: 2.780<br />mpg: 21.4"],"type":"scatter","mode":"markers","marker":{"autocolorscale":false,"color":"rgba(0,0,0,1)","opacity":1,"size":5.66929133858268,"symbol":"circle","line":{"width":1.88976377952756,"color":"rgba(0,0,0,1)"}},"hoveron":"points","showlegend":false,"xaxis":"x","yaxis":"y","hoverinfo":"text","frame":null}],"layout":{"margin":{"t":25.9626400996264,"r":9.9626400996264,"b":50.8094645080946,"l":50.8094645080946},"font":{"color":"rgba(0,0,0,1)","family":"","size":19.9252801992528},"xaxis":{"domain":[0,1],"automargin":true,"type":"linear","autorange":false,"range":[1.31745,5.61955],"tickmode":"array","ticktext":["2","3","4","5"],"tickvals":[2,3,4,5],"categoryorder":"array","categoryarray":["2","3","4","5"],"nticks":null,"ticks":"","tickcolor":null,"ticklen":4.9813200498132,"tickwidth":0,"showticklabels":true,"tickfont":{"color":"rgba(77,77,77,1)","family":"","size":15.9402241594022},"tickangle":-0,"showline":false,"linecolor":null,"linewidth":0,"showgrid":true,"gridcolor":"rgba(235,235,235,1)","gridwidth":0.905694554511491,"zeroline":false,"anchor":"y","title":{"text":"wt","font":{"color":"rgba(0,0,0,1)","family":"","size":19.9252801992528}},"hoverformat":".2f"},"yaxis":{"domain":[0,1],"automargin":true,"type":"linear","autorange":false,"range":[9.225,35.075],"tickmode":"array","ticktext":["10","15","20","25","30","35"],"tickvals":[10,15,20,25,30,35],"categoryorder":"array","categoryarray":["10","15","20","25","30","35"],"nticks":null,"ticks":"","tickcolor":null,"ticklen":4.9813200498132,"tickwidth":0,"showticklabels":true,"tickfont":{"color":"rgba(77,77,77,1)","family":"","size":15.9402241594022},"tickangle":-0,"showline":false,"linecolor":null,"linewidth":0,"showgrid":true,"gridcolor":"rgba(235,235,235,1)","gridwidth":0.905694554511491,"zeroline":false,"anchor":"x","title":{"text":"mpg","font":{"color":"rgba(0,0,0,1)","family":"","size":19.9252801992528}},"hoverformat":".2f"},"shapes":[{"type":"rect","fillcolor":null,"line":{"color":null,"width":0,"linetype":[]},"yref":"paper","xref":"paper","x0":0,"x1":1,"y0":0,"y1":1}],"showlegend":false,"legend":{"bgcolor":null,"bordercolor":null,"borderwidth":0,"font":{"color":"rgba(0,0,0,1)","family":"","size":15.9402241594022}},"hovermode":"closest","barmode":"relative"},"config":{"doubleClick":"reset","showSendToCloud":false},"source":"A","attrs":{"56b01a9f748":{"x":{},"y":{},"type":"scatter"}},"cur_data":"56b01a9f748","visdat":{"56b01a9f748":["function (y) ","x"]},"highlight":{"on":"plotly_click","persistent":false,"dynamic":false,"selectize":false,"opacityDim":0.2,"selected":{"opacity":1},"debounce":0},"shinyEvents":["plotly_hover","plotly_click","plotly_selected","plotly_relayout","plotly_brushed","plotly_brushing","plotly_clickannotation","plotly_doubleclick","plotly_deselect","plotly_afterplot","plotly_sunburstclick"],"base_url":"https://plot.ly"},"evals":[],"jsHooks":[]}</script>
```r
reactable::reactable(mtcars)
```
<div id="htmlwidget-8c2437dbb52d5930175c" class="reactable html-widget" style="width:auto;height:auto;"></div>
<script type="application/json" data-for="htmlwidget-8c2437dbb52d5930175c">{"x":{"tag":{"name":"Reactable","attribs":{"data":{".rownames":["Mazda RX4","Mazda RX4 Wag","Datsun 710","Hornet 4 Drive","Hornet Sportabout","Valiant","Duster 360","Merc 240D","Merc 230","Merc 280","Merc 280C","Merc 450SE","Merc 450SL","Merc 450SLC","Cadillac Fleetwood","Lincoln Continental","Chrysler Imperial","Fiat 128","Honda Civic","Toyota Corolla","Toyota Corona","Dodge Challenger","AMC Javelin","Camaro Z28","Pontiac Firebird","Fiat X1-9","Porsche 914-2","Lotus Europa","Ford Pantera L","Ferrari Dino","Maserati Bora","Volvo 142E"],"mpg":[21,21,22.8,21.4,18.7,18.1,14.3,24.4,22.8,19.2,17.8,16.4,17.3,15.2,10.4,10.4,14.7,32.4,30.4,33.9,21.5,15.5,15.2,13.3,19.2,27.3,26,30.4,15.8,19.7,15,21.4],"cyl":[6,6,4,6,8,6,8,4,4,6,6,8,8,8,8,8,8,4,4,4,4,8,8,8,8,4,4,4,8,6,8,4],"disp":[160,160,108,258,360,225,360,146.7,140.8,167.6,167.6,275.8,275.8,275.8,472,460,440,78.7,75.7,71.1,120.1,318,304,350,400,79,120.3,95.1,351,145,301,121],"hp":[110,110,93,110,175,105,245,62,95,123,123,180,180,180,205,215,230,66,52,65,97,150,150,245,175,66,91,113,264,175,335,109],"drat":[3.9,3.9,3.85,3.08,3.15,2.76,3.21,3.69,3.92,3.92,3.92,3.07,3.07,3.07,2.93,3,3.23,4.08,4.93,4.22,3.7,2.76,3.15,3.73,3.08,4.08,4.43,3.77,4.22,3.62,3.54,4.11],"wt":[2.62,2.875,2.32,3.215,3.44,3.46,3.57,3.19,3.15,3.44,3.44,4.07,3.73,3.78,5.25,5.424,5.345,2.2,1.615,1.835,2.465,3.52,3.435,3.84,3.845,1.935,2.14,1.513,3.17,2.77,3.57,2.78],"qsec":[16.46,17.02,18.61,19.44,17.02,20.22,15.84,20,22.9,18.3,18.9,17.4,17.6,18,17.98,17.82,17.42,19.47,18.52,19.9,20.01,16.87,17.3,15.41,17.05,18.9,16.7,16.9,14.5,15.5,14.6,18.6],"vs":[0,0,1,1,0,1,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0,0,1,0,1,0,0,0,1],"am":[1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1],"gear":[4,4,4,3,3,3,3,4,4,4,4,3,3,3,3,3,3,4,4,4,3,3,3,3,3,4,5,5,5,5,5,4],"carb":[4,4,1,1,2,1,4,2,2,4,4,3,3,3,4,4,4,1,2,1,1,2,2,4,2,1,2,2,4,6,8,2]},"columns":[{"accessor":".rownames","name":"","type":"character","sortable":false,"filterable":false},{"accessor":"mpg","name":"mpg","type":"numeric"},{"accessor":"cyl","name":"cyl","type":"numeric"},{"accessor":"disp","name":"disp","type":"numeric"},{"accessor":"hp","name":"hp","type":"numeric"},{"accessor":"drat","name":"drat","type":"numeric"},{"accessor":"wt","name":"wt","type":"numeric"},{"accessor":"qsec","name":"qsec","type":"numeric"},{"accessor":"vs","name":"vs","type":"numeric"},{"accessor":"am","name":"am","type":"numeric"},{"accessor":"gear","name":"gear","type":"numeric"},{"accessor":"carb","name":"carb","type":"numeric"}],"defaultPageSize":10,"paginationType":"numbers","showPageInfo":true,"minRows":1,"dataKey":"8ba9bd00ac0228f5482fccf7b7156c21"},"children":[]},"class":"reactR_markup"},"evals":[],"jsHooks":[]}</script>
---
#Interactivity!
If you have more than one page, make it *shiny*!
[{shiny}](https://shiny.rstudio.com/tutorial/*) allows you to make interactive web applications with R.
First, change your YAML.
```r
---
title: "Coolest DEMO EVER"
*runtime: shiny
output:
flexdashboard::flex_dashboard:
```
Next, assign your interactive plot or table to an object, and **render**.
```r
renderPlotly(plot1)
renderReactable(table1)
```
---
#I know what you're thinking.
Interactivity isn't enough. How can I make my dashboard even cooler?
### I have the answer. Icons.
I recommend using [Fontawesome icons](https://fontawesome.com/icons?d=gallery).But you can also use [ionicons](https://ionicons.com/).
```r
#Use the prefix "fa" for fontawesome icons or "ion" for ionicons.
Weird Flex {data-icon="fa-code-branch"}
=================================
```
![](img/icon.PNG)
---
# Want a logo?
So simple, my friends. Download a fontawesome icon to your project folder, and change your YAML.
Check the size of your png file!
```r
---
title: "Coolest DEMO EVER"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
* logo: coolpic.png
* favicon: coolicon.png
social: menu
source_code: https://github.com/akhilanekkanti1/dashboard_demo
---
```
---
# Storyboards
![](img/storyboard.PNG)
---
# Storyboard all the way.
1. First, change your YAML.
2. Use level 3 headers (###) for each frame in your storyboard.
```r
---
title: "Storyboard"
output:
flexdashboard::flex_dashboard:
* storyboard: true
---
*### Frame 1
*### Frame 2
*### Frame 3
```
---
# Storyboard all the way.
![](img/storyboard1.PNG)
---
# Storyboards on just one page.
1. Just add {.storyboard} to your page title.
```r
*Cool Story {.storyboard}
*==========================
*### Frame 1
*### Frame 2
```
![](img/storypage.PNG)
---
#Last but not least, [themes](https://rmarkdown.rstudio.com/flexdashboard/using.html#themes)!
https://rmarkdown.rstudio.com/flexdashboard/using.html#themes
```r
---
title: "Coolest DEMO EVER"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
* theme: united
social: menu
source_code: https://github.com/akhilanekkanti1/dashboard_demo
---
```
---
class: center, middle
# Thanks!
Slides created via the R package [**xaringan**](https://github.com/yihui/xaringan).
The chakra comes from [remark.js](https://remarkjs.com), [**knitr**](http://yihui.org/knitr), and [R Markdown](https://rmarkdown.rstudio.com).
</textarea>
<style data-target="print-only">@media screen {.remark-slide-container{display:block;}.remark-slide-scaler{box-shadow:none;}}</style>
<script src="https://remarkjs.com/downloads/remark-latest.min.js"></script>
<script>var slideshow = remark.create({
"highlightStyle": "atelier-dune-light",
"highlightLines": true,
"countIncrementalSlides": false
});
if (window.HTMLWidgets) slideshow.on('afterShowSlide', function (slide) {
window.dispatchEvent(new Event('resize'));
});
(function(d) {
var s = d.createElement("style"), r = d.querySelector(".remark-slide-scaler");
if (!r) return;
s.type = "text/css"; s.innerHTML = "@page {size: " + r.style.width + " " + r.style.height +"; }";
d.head.appendChild(s);
})(document);
(function(d) {
var el = d.getElementsByClassName("remark-slides-area");
if (!el) return;
var slide, slides = slideshow.getSlides(), els = el[0].children;
for (var i = 1; i < slides.length; i++) {
slide = slides[i];
if (slide.properties.continued === "true" || slide.properties.count === "false") {
els[i - 1].className += ' has-continuation';
}
}
var s = d.createElement("style");
s.type = "text/css"; s.innerHTML = "@media print { .has-continuation { display: none; } }";
d.head.appendChild(s);
})(document);
// delete the temporary CSS (for displaying all slides initially) when the user
// starts to view slides
(function() {
var deleted = false;
slideshow.on('beforeShowSlide', function(slide) {
if (deleted) return;
var sheets = document.styleSheets, node;
for (var i = 0; i < sheets.length; i++) {
node = sheets[i].ownerNode;
if (node.dataset["target"] !== "print-only") continue;
node.parentNode.removeChild(node);
}
deleted = true;
});
})();
(function() {
"use strict"
/* Replace <script> tags in slides area to make them executable
*
* Runs after post-processing of markdown source into slides and replaces only
* <script>s on the last slide of continued slides using the .has-continuation
* class added by xaringan. Finally, any <script>s in the slides area that
* aren't executed are commented out.
*/
var scripts = document.querySelectorAll(
'.remark-slides-area .remark-slide-container:not(.has-continuation) script'
);
if (!scripts.length) return;
for (var i = 0; i < scripts.length; i++) {
var s = document.createElement('script');
var code = document.createTextNode(scripts[i].textContent);
s.appendChild(code);
scripts[i].parentElement.replaceChild(s, scripts[i]);
}
var scriptsNotExecuted = document.querySelectorAll(
'.remark-slides-area .remark-slide-container.has-continuation script'
);
if (!scriptsNotExecuted.length) return;
for (var i = 0; i < scriptsNotExecuted.length; i++) {
var comment = document.createComment(scriptsNotExecuted[i].outerHTML)
scriptsNotExecuted[i].parentElement.replaceChild(comment, scriptsNotExecuted[i])
}
})();
(function() {
var links = document.getElementsByTagName('a');
for (var i = 0; i < links.length; i++) {
if (/^(https?:)?\/\//.test(links[i].getAttribute('href'))) {
links[i].target = '_blank';
}
}
})();
// adds .remark-code-has-line-highlighted class to <pre> parent elements
// of code chunks containing highlighted lines with class .remark-code-line-highlighted
(function(d) {
const hlines = d.querySelectorAll('.remark-code-line-highlighted');
const preParents = [];
const findPreParent = function(line, p = 0) {
if (p > 1) return null; // traverse up no further than grandparent
const el = line.parentElement;
return el.tagName === "PRE" ? el : findPreParent(el, ++p);
};
for (let line of hlines) {
let pre = findPreParent(line);
if (pre && !preParents.includes(pre)) preParents.push(pre);
}
preParents.forEach(p => p.classList.add("remark-code-has-line-highlighted"));
})(document);</script>
<script>
slideshow._releaseMath = function(el) {
var i, text, code, codes = el.getElementsByTagName('code');
for (i = 0; i < codes.length;) {
code = codes[i];
if (code.parentNode.tagName !== 'PRE' && code.childElementCount === 0) {
text = code.textContent;
if (/^\\\((.|\s)+\\\)$/.test(text) || /^\\\[(.|\s)+\\\]$/.test(text) ||
/^\$\$(.|\s)+\$\$$/.test(text) ||
/^\\begin\{([^}]+)\}(.|\s)+\\end\{[^}]+\}$/.test(text)) {
code.outerHTML = code.innerHTML; // remove <code></code>
continue;
}
}
i++;
}
};
slideshow._releaseMath(document);
</script>
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function () {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-MML-AM_CHTML';
if (location.protocol !== 'file:' && /^https?:/.test(script.src))
script.src = script.src.replace(/^https?:/, '');
document.getElementsByTagName('head')[0].appendChild(script);
})();
</script>
</body>
</html>