-
Notifications
You must be signed in to change notification settings - Fork 6
/
beyond-stats.html
936 lines (601 loc) · 25.3 KB
/
beyond-stats.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
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
<!DOCTYPE html>
<html>
<head>
<title>R beyond statistics</title>
<meta charset="utf-8">
<link href="libs/remark-css-0.0.1/default.css" rel="stylesheet" />
<link href="libs/remark-css-0.0.1/default-fonts.css" rel="stylesheet" />
<link href="libs/font-awesome-5.0.12/css/fontawesome-all.min.css" rel="stylesheet" />
</head>
<body>
<textarea id="source">
class: title-slide center middle inverse
<br>
<br>
# <i class="fab fa-r-project "></i> beyond statistics
<br>
<br>
## Florian Privé
### April 8, 2019
<br>
<br>
**Slides:** `privefl.github.io/R-presentation/beyond-stats.html`
---
## Contents
<br>
- Statistics & Data Science
- Visualization
- Reporting
- Web
- High Performance Computing
- Improvements to the language
- RStudio IDE
- Community
- Learn R
---
class: inverse, center, middle
# Statistics & Data Science
---
## Just one example in Statistics:
### glmnet: Lasso and Elastic-Net Regularized Generalized Linear Models
Extremely efficient procedures for fitting the entire lasso or elastic-net regularization path for
- linear regression,
- logistic and multinomial regression models,
- Poisson regression and
- the Cox model.
Two recent additions are the
- multiple-response Gaussian, and
- the grouped multinomial regression.
**With so many options!**
---
## Work with many kinds of data
<br>
- tabular tidy data (see [this book](http://r4ds.had.co.nz/))
- spatial (see [this book](https://bookdown.org/robinlovelace/geocompr/) and [this blog](https://statnmap.com/))
- temporal (see [this book](https://otexts.org/fpp2/))
- textual (see [this book](https://www.tidytextmining.com/))
- networks (see [this book](https://sites.fas.harvard.edu/~airoldi/pub/books/BookDraft-CsardiNepuszAiroldi2016.pdf))
- etc
- etc
- etc
---
## Data manipulation
<br>
- [{data.table}](https://github.com/Rdatatable/data.table/wiki) is very fast
<img src="http://hexb.in/hexagons/r-datatable.png" width="20%" style="display: block; margin: auto;" />
- [{dplyr}](https://github.com/tidyverse/dplyr) is often fast enough and has a very intuitive syntax
<img src="https://raw.githubusercontent.com/rstudio/hex-stickers/master/PNG/dplyr.png" width="20%" style="display: block; margin: auto;" />
---
## Data manipulation with {dplyr}
```r
library(dplyr)
(flights <- nycflights13::flights)
```
```
# A tibble: 336,776 x 19
year month day dep_time sched_dep_time dep_delay arr_time
<int> <int> <int> <int> <int> <dbl> <int>
1 2013 1 1 517 515 2 830
2 2013 1 1 533 529 4 850
3 2013 1 1 542 540 2 923
4 2013 1 1 544 545 -1 1004
5 2013 1 1 554 600 -6 812
6 2013 1 1 554 558 -4 740
7 2013 1 1 555 600 -5 913
8 2013 1 1 557 600 -3 709
9 2013 1 1 557 600 -3 838
10 2013 1 1 558 600 -2 753
# … with 336,766 more rows, and 12 more variables:
# sched_arr_time <int>, arr_delay <dbl>, carrier <chr>,
# flight <int>, tailnum <chr>, origin <chr>, dest <chr>,
# air_time <dbl>, distance <dbl>, hour <dbl>, minute <dbl>,
# time_hour <dttm>
```
---
## Data manipulation with {dplyr}
<br>
R package {dplyr} aims to provide a function for each basic verb of data manipulation:
- `filter()`
- `arrange()`
- `select()`
- `mutate()`
- `group_by()`
- `summarise()`
- and many others..
---
## Filtering observations
```r
filter(flights, month == 1, day == 1)
```
```
# A tibble: 842 x 19
year month day dep_time sched_dep_time dep_delay arr_time
<int> <int> <int> <int> <int> <dbl> <int>
1 2013 1 1 517 515 2 830
2 2013 1 1 533 529 4 850
3 2013 1 1 542 540 2 923
4 2013 1 1 544 545 -1 1004
5 2013 1 1 554 600 -6 812
6 2013 1 1 554 558 -4 740
7 2013 1 1 555 600 -5 913
8 2013 1 1 557 600 -3 709
9 2013 1 1 557 600 -3 838
10 2013 1 1 558 600 -2 753
# … with 832 more rows, and 12 more variables: sched_arr_time <int>,
# arr_delay <dbl>, carrier <chr>, flight <int>, tailnum <chr>,
# origin <chr>, dest <chr>, air_time <dbl>, distance <dbl>,
# hour <dbl>, minute <dbl>, time_hour <dttm>
```
---
## Sorting
```r
arrange(flights, desc(dep_delay))
```
```
# A tibble: 336,776 x 19
year month day dep_time sched_dep_time dep_delay arr_time
<int> <int> <int> <int> <int> <dbl> <int>
1 2013 1 9 641 900 1301 1242
2 2013 6 15 1432 1935 1137 1607
3 2013 1 10 1121 1635 1126 1239
4 2013 9 20 1139 1845 1014 1457
5 2013 7 22 845 1600 1005 1044
6 2013 4 10 1100 1900 960 1342
7 2013 3 17 2321 810 911 135
8 2013 6 27 959 1900 899 1236
9 2013 7 22 2257 759 898 121
10 2013 12 5 756 1700 896 1058
# … with 336,766 more rows, and 12 more variables:
# sched_arr_time <int>, arr_delay <dbl>, carrier <chr>,
# flight <int>, tailnum <chr>, origin <chr>, dest <chr>,
# air_time <dbl>, distance <dbl>, hour <dbl>, minute <dbl>,
# time_hour <dttm>
```
---
## Adding/replacing variables
```r
mutate(flights, speed = distance / air_time * 60)
```
```
# A tibble: 336,776 x 20
year month day dep_time sched_dep_time dep_delay arr_time
<int> <int> <int> <int> <int> <dbl> <int>
1 2013 1 1 517 515 2 830
2 2013 1 1 533 529 4 850
3 2013 1 1 542 540 2 923
4 2013 1 1 544 545 -1 1004
5 2013 1 1 554 600 -6 812
6 2013 1 1 554 558 -4 740
7 2013 1 1 555 600 -5 913
8 2013 1 1 557 600 -3 709
9 2013 1 1 557 600 -3 838
10 2013 1 1 558 600 -2 753
# … with 336,766 more rows, and 13 more variables:
# sched_arr_time <int>, arr_delay <dbl>, carrier <chr>,
# flight <int>, tailnum <chr>, origin <chr>, dest <chr>,
# air_time <dbl>, distance <dbl>, hour <dbl>, minute <dbl>,
# time_hour <dttm>, speed <dbl>
```
---
## Piping operations
```r
flights2 <- flights %>%
filter(month == 1, day == 1) %>%
arrange(desc(dep_delay)) %>%
mutate(speed = distance / air_time * 60)
print(flights2, n = 6)
```
```
# A tibble: 842 x 20
year month day dep_time sched_dep_time dep_delay arr_time
<int> <int> <int> <int> <int> <dbl> <int>
1 2013 1 1 848 1835 853 1001
2 2013 1 1 2343 1724 379 314
3 2013 1 1 1815 1325 290 2120
4 2013 1 1 2205 1720 285 46
5 2013 1 1 1842 1422 260 1958
6 2013 1 1 2115 1700 255 2330
# … with 836 more rows, and 13 more variables: sched_arr_time <int>,
# arr_delay <dbl>, carrier <chr>, flight <int>, tailnum <chr>,
# origin <chr>, dest <chr>, air_time <dbl>, distance <dbl>,
# hour <dbl>, minute <dbl>, time_hour <dttm>, speed <dbl>
```
---
## Summarizing by group
```r
flights %>%
group_by(carrier) %>%
summarize(avg_arr_delay = mean(arr_delay, na.rm = TRUE)) %>%
arrange(desc(avg_arr_delay)) %>%
left_join(nycflights13::airlines)
```
```
Joining, by = "carrier"
```
```
# A tibble: 16 x 3
carrier avg_arr_delay name
<chr> <dbl> <chr>
1 F9 21.9 Frontier Airlines Inc.
2 FL 20.1 AirTran Airways Corporation
3 EV 15.8 ExpressJet Airlines Inc.
4 YV 15.6 Mesa Airlines Inc.
5 OO 11.9 SkyWest Airlines Inc.
6 MQ 10.8 Envoy Air
7 WN 9.65 Southwest Airlines Co.
8 B6 9.46 JetBlue Airways
9 9E 7.38 Endeavor Air Inc.
10 UA 3.56 United Air Lines Inc.
11 US 2.13 US Airways Inc.
12 VX 1.76 Virgin America
13 DL 1.64 Delta Air Lines Inc.
14 AA 0.364 American Airlines Inc.
15 HA -6.92 Hawaiian Airlines Inc.
16 AS -9.93 Alaska Airlines Inc.
```
---
## {dplyr} also works with databases
<img src="https://d33wubrfki0l68.cloudfront.net/738885c8f54f3ab6118545469c28cd6635fcd656/96e0d/homepage/interact.png" width="80%" style="display: block; margin: auto;" />
Connect to DBs such as MySQL, MariaDB, Postgres, Redshift, SQLite, Google’s BigQuery... and use {dplyr} instead of SQL.
.footnote[Learn more at https://db.rstudio.com/dplyr/ and with [this webinar](https://www.rstudio.com/resources/videos/best-practices-for-working-with-databases-webinar/).]
---
## Machine Learning & Deep Learning
### Package {caret}
The caret package (short for **C**lassification **A**nd **RE**gression **T**raining) is a set of functions that attempt to streamline the process for creating predictive models (see [the full documentation](http://topepo.github.io/caret/index.html)). The package contains tools for:
- data splitting
- pre-processing
- feature selection
- model tuning using resampling
- variable importance estimation
### Keras & TensorFlow in R
Keras & TensorFlow are integrated in R
- [TensorFlow for R](https://TensorFlow.rstudio.com/)
- [TensorFlow for R blog](https://blogs.rstudio.com/TensorFlow/)
---
class: center middle inverse
# Visualization
---
## Package {ggplot2} and extensions
<img src="http://www.sthda.com/english/rpkgs/ggpubr/tools/README-ggpubr-box-plot-dot-plots-strip-charts-3.png" width="75%" style="display: block; margin: auto;" />
---
## Animate graphics with [{gganimate}](https://github.com/thomasp85/gganimate)
<img src="https://privefl.github.io/R-presentation/whatrcando_files/figure-html/unnamed-chunk-12-1.gif" width="70%" style="display: block; margin: auto;" />
---
## Fancy graphics: [alluvial diagrams](https://github.com/mbojan/alluvial)
<img src="beyond-stats_files/figure-html/unnamed-chunk-13-1.svg" width="80%" style="display: block; margin: auto;" />
.footnote[More nice plots in [the R Graph Gallery](https://www.r-graph-gallery.com/).]
---
## Image processing
- [{magick}](https://github.com/ropensci/magick)
- [{imager}](https://github.com/dahtah/imager) (by Simon Barthelmé, GIPSA-lab)
<img src="https://raw.githubusercontent.com/privefl/R-presentation/master/parrots.gif" width="80%" style="display: block; margin: auto;" />
---
class: center middle inverse
# Reporting
---
## R Markdown
- Reports (analysis, etc) with text, code and results in the same place! With many possible output formats including HTML, PDF, MS Word, beamer, etc.
- Many supported languages:
```
awk, bash, coffee, gawk, groovy, haskell, lein, mysql, node,
octave, perl, psql, Rscript, ruby, sas, scala, sed, sh, stata,
zsh, highlight, Rcpp, tikz, dot, c, fortran, fortran95, asy, cat,
asis, stan, block, block2, js, css, sql, go, python, julia
```
- Notebooks
- HTML presentations (like this one! -- see [source code](https://github.com/privefl/R-presentation/blob/master/beyond-stats.Rmd))
- websites (such as [the website of our R user group](https://r-in-grenoble.github.io/))
- books (e.g. my online [advanced R course](https://privefl.github.io/advr38book/) or even [a thesis](https://keurcien.github.io/book/introduction.html))
- [WIP] [{pagedown}](https://github.com/rstudio/pagedown): Paginate the HTML Output of R Markdown with CSS for Print
---
class: center middle inverse
# Web
---
## Web scrapping
(Remember to be nice on the web with [{polite}](https://github.com/dmi3kno/polite))
```r
library(rvest)
read_html("https://r-in-grenoble.github.io/sessions.html") %>%
html_nodes(".schedule") %>%
html_nodes(".center-title") %>%
html_text() %>%
gsub("\n", "", .) %>%
writeLines()
```
```
What R can do for you
Image processing with package {imager}
Linear models in R
Manage your workflow with package {drake}
Deep Learning with package {keras}
Machine Learning with package {caret}
Best coding practices
R Markdown
Data manipulation with package {dplyr}
Data vizualisation with package {ggplot2}
```
---
## R clients to interact with APIs
- libcurl: https://cran.r-project.org/package=RCurl
- Twitter: https://github.com/mkearney/rtweet
- Gmail: https://github.com/jimhester/gmailr
- Google Spreadsheets: https://github.com/jennybc/googlesheets
- Google Analytics: https://github.com/MarkEdmondson1234/googleAnalyticsR
- GitHub: https://github.com/r-lib/gh
- Cloud computing / Web services: https://github.com/cloudyr
- dbSNP / openSNP: https://github.com/ropensci/rsnps
- OpenStreetMap: https://github.com/ropensci/osmdata
- [Géo](https://api.gouv.fr/api/api-geo.html): https://github.com/ColinFay/rgeoapi
- etc
- etc
---
## Shiny apps: web apps in R
<br>
- Example 1: [Airbnb visualization in New York](https://yuyuhan0306.shinyapps.io/airbnb_yuhan/)
- Example 2: [Make pixel art models](https://florianprive.shinyapps.io/pixelart/)
<br>
[Learn more](https://privefl.github.io/advr38book/shiny.html)
---
class: center middle inverse
# High Performance Computing
---
## [Integrate C++ code with {Rcpp}](https://privefl.github.io/R-presentation/Rcpp.html)
<br>
Rcpp lives between R and C++, so that you can get
- the *performance of C++* and
- the *convenience of R*.
<br>
As
- I love *performance* and
- I also enjoy *simplicity*,
Rcpp might be my favorite R package.
---
## Easy parallelism with [{future}](https://github.com/HenrikBengtsson/future)
<blockquote class="twitter-tweet" data-lang="en" align="center" width="55%"><p lang="en" dir="ltr">future 1.0.0 on CRAN - cross-platform parallel evaluation via a single unified API <a href="https://twitter.com/hashtag/rstats?src=hash&amp;ref_src=twsrc%5Etfw">#rstats</a> <a href="https://t.co/uxIozDAWHA">https://t.co/uxIozDAWHA</a> <a href="https://t.co/wV5vhcgpMJ">pic.twitter.com/wV5vhcgpMJ</a></p>&mdash; Henrik Bengtsson (@henrikbengtsson) <a href="https://twitter.com/henrikbengtsson/status/746906359484973057?ref_src=twsrc%5Etfw">26 juin 2016</a></blockquote>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
.footnote[Also see [my intro to parallelism with {foreach}](https://privefl.github.io/blog/a-guide-to-parallelism-in-r/).]
---
## Scalable reproducible workflow with [{drake}](https://ropensci.github.io/drake/)
<br>
<br>
<img src="https://ropensci.github.io/drake/images/graph.png" width="90%" style="display: block; margin: auto;" />
---
## Large matrices with [{bigstatsr}](https://github.com/privefl/bigstatsr)
### Advantages of using Filebacked Big Matrix (FBM) objects
<br>
- you can apply algorithms on **data larger than your RAM**,
- you can easily **parallelize** your algorithms because the data on disk is shared,
- you write **more efficient algorithms** (you do less copies and think more about what you're doing),
- you can use **different types of data**, for example, in my field, I’m storing my data with only 1 byte per element (rather than 8 bytes for a standard R matrix). See [the documentation of the FBM class](https://privefl.github.io/bigstatsr/reference/FBM-class.html) for details.
---
class: center middle inverse
# Improvements to the language
---
## Just-in-time compiler
<br>
.pull-left[
```r
compiler::enableJIT(0)
```
```
[1] 3
```
```r
system.time({
N <- 1e6
res <- numeric(N)
for (i in 2:N) {
res[i] <- res[i - 1] + 1;
}
})
```
```
user system elapsed
1.406 0.000 1.406
```
]
.pull-right[
```r
compiler::enableJIT(3)
```
```
[1] 0
```
```r
system.time({
N <- 1e6
res <- numeric(N)
for (i in 2:N) {
res[i] <- res[i - 1] + 1;
}
})
```
```
user system elapsed
0.111 0.000 0.111
```
<br>
Since R 3.4
]
---
## Growing vectors
<br>
.pull-left[
```r
system.time({
N <- 3e4
res <- c(0)
for (i in 2:N) {
new_val <- res[i - 1] + 1
res <- c(res, new_val)
}
})
```
```
user system elapsed
1.440 0.041 1.483
```
]
.pull-right[
```r
system.time({
N <- 3e4
res <- c(0)
for (i in 2:N) {
new_val <- res[i - 1] + 1
res[i] <- new_val;
}
})
```
```
user system elapsed
0.013 0.000 0.013
```
<br>
Since R 3.4
]
.footnote[Read more [there](https://blog.revolutionanalytics.com/2017/02/preview-r-340.html).]
---
## ALTREP (since R 3.5)
### An alternative way of representing R objects internally
Before :
```r
x <- 1:1e10
```
```
Error: cannot allocate vector of size 74.5 Gb
```
After:
```r
x <- 1:1e10
.Internal(inspect(x))
```
```
@67ddb58 14 REALSXP g0c0 [NAM(3)] 1 : 10000000000 (compact)
```
```r
sum(x)
```
```
[1] 5e+19
```
---
class: center middle inverse
# RStudio
---
## RStudio IDE really helps
<br>
- console / scripts / environment / plots
- code diagnostics
- projects (+ git panel)
- viewer / debugger / profiler
- interactive import / connection
- integrated terminal / HTML viewer
- support many programming languages
- RStudio server to open RStudio in a web brower, with code running on a distant server
---
## RStudio for Python?
<blockquote class="twitter-tweet" data-lang="en" align="center"><p lang="en" dir="ltr">What is one of the better interactive data analysis editor / environments for <a href="https://twitter.com/hashtag/Python?src=hash&amp;ref_src=twsrc%5Etfw">#Python</a>? <a href="https://twitter.com/rstudio?ref_src=twsrc%5Etfw">@rstudio</a> :-)<br><br>The new RSTUDIO 1.2 release will have support for python REPL <a href="https://twitter.com/hashtag/rstats?src=hash&amp;ref_src=twsrc%5Etfw">#rstats</a> <a href="https://twitter.com/hashtag/MachineLearning?src=hash&amp;ref_src=twsrc%5Etfw">#MachineLearning</a> <a href="https://twitter.com/hashtag/visualization?src=hash&amp;ref_src=twsrc%5Etfw">#visualization</a> <a href="https://t.co/lUvP3qYd4z">pic.twitter.com/lUvP3qYd4z</a></p>&mdash; Longhow Lam 林 隆 豪 (@longhowlam) <a href="https://twitter.com/longhowlam/status/1022821624318447616?ref_src=twsrc%5Etfw">27 juillet 2018</a></blockquote>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
---
class: center middle inverse
# Community
---
## A welcoming and inclusive community
<br>
<blockquote class="twitter-tweet" data-lang="en" align="center"><p lang="en" dir="ltr">I&#39;m curious as to how the R community came to be so supportive and welcoming (as opposed to so much of the tech world). Anyone have ideas? <a href="https://twitter.com/hashtag/rstats?src=hash&amp;ref_src=twsrc%5Etfw">#rstats</a></p>&mdash; David Keyes (@dgkeyes) <a href="https://twitter.com/dgkeyes/status/1113547867984027648?ref_src=twsrc%5Etfw">3 avril 2019</a></blockquote>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<br>
- [R Ladies](https://rladies.org/)
- [R Forwards](https://forwards.github.io/)
- etc
---
## Open Science: rOpenSci community
<br>
<img src="https://i2.wp.com/www.numfocus.org/wp-content/uploads/2017/08/rOpenSci_logo_with_lettering-300x165.png" width="40%" style="display: block; margin: auto;" />
<br>
Packages in scope: data retrieval & extraction, scientific software wrappers, database access, data munging, data deposition, reproducibility, geospatial data, and text analysis.
Packages are openly reviewed to unsure quality.
---
## Open to many other languages
<br>
- C++ via [{Rcpp}](https://github.com/RcppCore/Rcpp)
- Python via [{reticulate}](https://rstudio.github.io/reticulate/)
- Java vua [{rJava}](https://github.com/s-u/rJava)
- Julia via [{JuliaCall}](https://github.com/Non-Contradiction/JuliaCall)
- JavaScript via [{V8}](https://github.com/jeroen/v8)
- JavaScript visualization via [{htmlwidgets}](https://www.htmlwidgets.org/)
- etc
- Beyond: [Apache Arrow](https://github.com/apache/arrow): cross-language development platform for in-memory data. Languages currently supported include C, C++, C#, Go, Java, JavaScript, MATLAB, Python, R, Ruby, and Rust.
---
class: center middle inverse
# Where to learn R?
---
## Where to learn R?
- [An Introduction to R](https://colinfay.me/intro-to-r/) by the R core team
- [Introduction to R](https://www.datacamp.com/courses/free-introduction-to-r) by DataCamp
- [R for Data Science](http://r4ds.had.co.nz/index.html) by Garrett Grolemund & Hadley Wickham, and [some solutions](https://jrnold.github.io/r4ds-exercise-solutions/)
- [Advanced R](http://adv-r.had.co.nz/) by Hadley Wickham, and [some solutions](https://bookdown.org/Tazinho/Advanced-R-Solutions/)
- [Useful packages for Data Science](https://github.com/rstudio/RStartHere)
- [CRAN Task Views](https://cran.r-project.org/web/views/)
- [Advanced R course](https://privefl.github.io/advr38book/index.html)
- Read code, documentation, blog posts, etc. And PRACTICE.
- Learn from others
- [join the French-speaking R community](https://join.slack.com/t/r-grrr/shared_invite/enQtMzI4MzgwNTc4OTAxLWZlOGZiZTBiMWU0NDQ3OTYzOGE1YThiODgwZWNhNWEyYjI4ZDJiNmNhY2YyYWI5YzFiOTFkNDYxYzkwODUwNWM)
- [join the R-Ladies community](https://rladies-community-slack.herokuapp.com/)
---
class: inverse, center, middle
# Thanks!
<br>
**Slides:** `privefl.github.io/R-presentation/beyond-stats.html`
<br>
<i class="fab fa-twitter "></i> [privefl](https://twitter.com/privefl) &nbsp;&nbsp;&nbsp;&nbsp; <i class="fab fa-github "></i> [privefl](https://github.com/privefl) &nbsp;&nbsp;&nbsp;&nbsp; <i class="fab fa-stack-overflow "></i> [F. Privé](https://stackoverflow.com/users/6103040/f-priv%c3%a9)
.footnote[Slides created via the R package [**xaringan**](https://github.com/yihui/xaringan).]
</textarea>
<script src="https://remarkjs.com/downloads/remark-latest.min.js"></script>
<script>var slideshow = remark.create({
"highlightStyle": "github",
"highlightLines": true,
"countIncrementalSlides": true
});
if (window.HTMLWidgets) slideshow.on('afterShowSlide', function (slide) {
window.dispatchEvent(new Event('resize'));
});
(function() {
var d = document, 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);
})();</script>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<script>
(function() {
var i, text, code, codes = document.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++;
}
})();
</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>