class: center, middle, inverse, title-slide # Next steps ### The R Bootcamp @ Erfurt
www.therbootcamp.com
@therbootcamp
### June 2018 --- # Next steps .pull-left4[ <font size = 4><i>What we would have liked to cover</i><br> <font size = 6> 1. Networks<br> 2. Text analysis<br> 3. Statistics<br> 4. Rcpp<br> 5. Forms<br> </font> <br> <font size = 4><i>How to continue</i><br> <font size = 6> 6. Books<br> 7. Websites R<br> </font> ] .pull-right5[ <p align="center"><img src="https://i0.wp.com/www.pieceofk.fr/wp-content/uploads/2017/09/Rplot.png?zoom=2&w=450" width=400 align="center"><br><br> <font size=2>source <a href="https://www.r-bloggers.com/exploring-the-cran-social-network/">R-bloggers.com</a> </p> ] --- # Network analysis A social graph of package Co-authors using `tidyverse` plus `ggraph`, an extension for `ggplot2` for graphs (aka networks) and `igraph`, an extremely powerful network analysis library. Find the code and additional explanation [**here**](https://www.r-bloggers.com/exploring-the-cran-social-network/). .pull-left[ <p align="center"><img src="https://i1.wp.com/www.pieceofk.fr/wp-content/uploads/2017/09/Rplot04.png?zoom=2&w=450" width=450><br> <font size=2>source <a href="https://www.r-bloggers.com/exploring-the-cran-social-network/">R-bloggers.com</a></p> ] .pull-right[ <p align="center"> <br><br> <img src="https://i1.wp.com/www.pieceofk.fr/wp-content/uploads/2017/09/Rplot02.png?zoom=2&w=450" width=450><br><br><br> <font size=2>source <a href="https://www.r-bloggers.com/exploring-the-cran-social-network/">R-bloggers.com</a></p> ] --- # Text analysis Another area were R has seen much development is **text analysis**. New packages provide access to lightning fast **C++ string libraries**, 'new' data formats such as **html**, **xml**, and **json**, and also to the API of social platforms, such as [**facebook.com**](www.facebook.com) and [**twitter.com**](www.twitter.com). <br><br> | Package| Description| |:------|:------------| | `tm`, `tidytext` | General text analysis packages | | `stringr`, `stringi` | String operations and regular expressions. | | `rvest`, `XML` | Scraping content of the internet| | `text2vec`| Create vector representation of words. | | `SentimentAnalysis`| Sentiment analysis.| | `twitteR`, `streamR`, `jsonlite`| Streaming and parsing tweets. | | `Rfacebook`| Accessing the Facebook API. | --- # Text analysis: Applications - [**hedonometer.org**](http://hedonometer.org/books/v1/) <br2> <p align="center"><a href="http://hedonometer.org/books/v1/"> <img src="https://raw.githubusercontent.com/therbootcamp/therbootcamp.github.io/master/_sessions/_image/harry_potter.png" width=900></a><br> <font size=3>Link to <a href="https://arxiv.org/pdf/1606.07772.pdf">Paper</a></font><br> <font size=3>View <a href="https://www.youtube.com/watch?v=oP3c1h8v2ZQ">Vonnegut's Shape of Stories</a></font></p> --- # Stats packages >"If there is a new statistical method, it is first implemented in R" <br> > -- duw <br> | Package| Description| |:------|:------------| | `stats` | Many individual tests plus all the distributions in the world.| | `lme`, `glm` | (Generalized) linear models.| | `lme4`, `afex` | Mixed-mode, hierarchical regression.| | `caret`, `mlr`, `e1071`, `rpart`, etc.| Machine learning.| | `BayesFactor`, `rstanarm`| Bayesian linear models.| | `rjags`, `rstan`| Bayesian graphical models.| | `forecast`, `mgm`, `timeSeries`, etc.| Time series models.| | `cluster`, `fastcluster`, `cstab`, etc.| Cluster analysis.| --- # Deep learning <img src="https://cdn-images-1.medium.com/max/1600/1*R9Vd96dBUU2fJO9dnK0igA.png"> --- # Deep learning: Tensorflow .pull-left5[ ```r # Get Keras install.packages(keras) library(keras) install_keras() # Define model model <- keras_model_sequential() model %>% layer_dense(units = 256, activation = 'relu', input_shape = c(784)) %>% layer_dropout(rate = 0.4) %>% layer_dense(units = 128, activation = 'relu') %>% layer_dropout(rate = 0.3) %>% layer_dense(units = 10, activation = 'softmax') ``` ] .pull-right45[ <a href="https://tensorflow.rstudio.com/"><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/TensorFlowLogo.svg/2000px-TensorFlowLogo.svg.png" height = 400></a> ] --- # Rcpp By now one of the most referenced R packages is Rcpp - **R's interface to C++**. With often relatively little effort due to **Rcpp sugar**, Rcpp can provide vast speed improvements, which many packages today rely on Rcpp in the background for **swift code execution**. Rcpp becomes particularly powerful, when supplemented with `BH`, which makes available a collection **free, peer-reviewed C++ libraries**, and [RcppArmdillo](http://arma.sourceforge.net/), which available the high-performance *Armadillo* library for linear algebra methods. .pull-left4[ <p align="center"> <img src="https://classic105.s3.amazonaws.com/wp-content/uploads/2017/05/180207142-sugar.jpg" width=350><br> <font size=2>source <a href="https://classic105.s3.amazonaws.com/wp-content/uploads/2017/05/180207142-sugar.jpg/">classic105.com</a></p> ] .pull-right6[ <p align="center"> <img src="https://raw.githubusercontent.com/therbootcamp/therbootcamp.github.io/master/_sessions/_image/Rcpp.png" width=480><br><br2> <font size=2><a href="http://dirk.eddelbuettel.com/code/rcpp/Rcpp-quickref.pdf">Quick Reference Guide</a></p> ] --- .pull-left5[ # Google Forms & Maps New packages also allow you to interact with [Google Maps](https://www.google.com/maps) and [Google Forms](https://docs.google.com/forms). Use `ggmap` to access Google Maps and `googlesheets` to access Google Forms. ```r library(ggmap) ggmap(get_map(c(7.588576, 47.559601),zoom=16)) ``` <p align="center"> <img src="https://raw.githubusercontent.com/therbootcamp/therbootcamp.github.io/master/_sessions/_image/basel.png" width=350></p> ] .pull-right45[ <p align="center"><br><br><iframe src="https://docs.google.com/forms/d/e/1FAIpQLSf1yqf1sq02Dm1dxHtnbFd6IiwyeqweE9p3pLMCTL2YcupI2g/viewform?embedded=true" width="430" height="500" frameborder="0" marginheight="0" marginwidth="0">Loading...</iframe></p> ] --- # How to continue .pull-left5[ <font size = 4><i> <font size = 6> 1. Practice<br> 2. Read books<br> 3. Consult websites<br> ] </font> <br> .pull-right5[ <p align="center"><img border="0" alt="W3Schools" src="http://www.theunmanageableemployee.com/wp-content/uploads/2011/07/5cs-stones-cropped-11052730.jpg?w=112"></p> ] --- # Books Here is a very incomplete series of good books. They are ordered by complexity, beginning with user-friendly books on **learning statistics** in R and ending with books focusing on the more **advanced topics of the R language**. <table width="100%" style="cellspacing:0; cellpadding:0; border:none"> <tr> <td> <a href="https://bookdown.org/ndphillips/YaRrr/"><img border="0" alt="W3Schools" src="https://bookdown.org/ndphillips/YaRrr/images/YaRrr_Cover.jpg" height="180"></a> </td> <td> <a href="https://uk.sagepub.com/en-gb/eur/change-location/0"><img border="0" alt="W3Schools" src="http://t3.gstatic.com/images?q=tbn:ANd9GcSbjn-7l52NdtNguTjP85sJ7QOTVTo5OegVC8bOrS34QSBucXCW" height="180" ></a> </td> <td> <a href="http://r4ds.had.co.nz/"><img border="0" alt="W3Schools" src="http://r4ds.had.co.nz/cover.png" height="180"></a> </td> <td> <a href="https://covers.oreillystatic.com/images/0636920028574/cat.gif"><img border="0" alt="W3Schools" src="https://covers.oreillystatic.com/images/0636920028574/cat.gif" height="180"></a> </td> <td> <a href="http://ggplot2.org/book/"><img border="0" alt="W3Schools" src="http://t1.gstatic.com/images?q=tbn:ANd9GcQNvhEpXp9OwvqVosEh-UecM3TNbhdb1eVZp3LywUcXGeVC3scQ" height="180"></a> </td> <td> <a href="https://www.tidytextmining.com/"><img border="0" alt="W3Schools" src="https://www.tidytextmining.com/images/cover.png" height="180" ></a> </td> <td> <a href="http://appliedpredictivemodeling.com/"><img border="0" alt="W3Schools" src="http://static1.squarespace.com/static/51156277e4b0b8b2ffe11c00/t/51157487e4b0b8b2ffe16829/1509217882069/?format=1500w" height="180" ></a> </td> <td> <a href="http://www-bcf.usc.edu/~gareth/ISL/ISLR%20First%20Printing.pdf"><img border="0" alt="W3Schools" src="https://images-na.ssl-images-amazon.com/images/I/41EaH4W9LVL._SX332_BO1,204,203,200_.jpg" height="180" ></a> </td> </tr> <tr> <td> <a href="https://www.amazon.com/Doing-Bayesian-Data-Analysis-Second/dp/0124058884"><img border="0" alt="W3Schools" src="http://t1.gstatic.com/images?q=tbn:ANd9GcTRRlqFPDLuz1b1FRqtL_bcVrILqPEJgh17piFhG-zwXYN_nCWm" height="180" ></a> </td> <td> <a href="https://www.manning.com/books/deep-learning-with-r"><img border="0" alt="W3Schools" src=" http://t2.gstatic.com/images?q=tbn:ANd9GcTfqjySUegtFHmrss1s042VPMfeotHpu1VZFSrOtGz0N-K3EsiB" height="180" ></a> </td> <td> <a href="https://csgillespie.github.io/efficientR/"><img border="0" alt="W3Schools" src="https://csgillespie.github.io/efficientR/figures/f0_web.png" height="180" ></a> </td> <td> <a href="www.rcpp.org/"><img border="0" alt="W3Schools" src="http://t3.gstatic.com/images?q=tbn:ANd9GcSO9T6JQYtpQgcaCXudbqMB-fnvTjGowsnmeh9-BQku3zveR4-J" height="180" ></a> </td> <td> <a href="https://www.wiley.com/en-us/The+R+Book%2C+2nd+Edition-p-9780470973929"><img border="0" alt="W3Schools" src="https://media.wiley.com/product_data/coverImage300/27/04709739/0470973927.jpg" height="180" ></a> </td> <td> <a href="http://adv-r.had.co.nz/"><img border="0" alt="W3Schools" src="https://images.tandf.co.uk/common/jackets/amazon/978146658/9781466586963.jpg" height="180" ></a> </td> <td> <a href="http://r-pkgs.had.co.nz/"><img border="0" alt="W3Schools" src="http://t3.gstatic.com/images?q=tbn:ANd9GcQdwOQxaWZnTc2s55ltS2NL8jpxbnD0sEC6QNPiHKPrIM-AHmAB" height="180" ></a> </td> <td> <a href="https://images-na.ssl-images-amazon.com/images/I/41eCbcQARTL._SX342_BO1,204,203,200_.jpg"><img border="0" alt="W3Schools" src="https://images-na.ssl-images-amazon.com/images/I/41eCbcQARTL._SX342_BO1,204,203,200_.jpg" height="180" ></a> </td> </tr> </table> <br> --- .pull-left4[ # Websites The web is a great place to learn about R. <font size = 4><i>Best begin your journey with:</i></font> [**Google**](www.google.com) or [**Rseek**](www.rseek.org), which is a wrapper around google to maximize hits related to R. However, most of the time Google works just fine. Just be sure to add *r* to the the search query. <font size = 4><i>Then you will most likely be redirected to one of two pages</i></font> [**R-bloggers**](www.r-bloggers.com) is a website on which R users inform each other on the newest developments. See, e.g., Nathaniel's [entry](https://www.r-bloggers.com/the-new-and-improved-pirateplot-now-with-themes/). [**Stackoverflow**](www.r-bloggers.com) is a website on which R users exchange problems and solutions to problems. Try posting something yourself. You will be amazed by the turnaround. ] .pull-right5[ <p align="left" style="padding: 0 0px"><br><br><br><br><br><br><br><br><br> <a href="https://www.google.com/"><img border="0" alt="W3Schools" src="https://raw.githubusercontent.com/therbootcamp/therbootcamp.github.io/master/_sessions/_image/google.png" height="100"></a><img border="0" alt="W3Schools" src="https://raw.githubusercontent.com/therbootcamp/therbootcamp.github.io/master/_sessions/_image/comma.png" height="50"><a href="http://rseek.org/"><img border="0" alt="W3Schools" src="https://raw.githubusercontent.com/therbootcamp/therbootcamp.github.io/master/_sessions/_image/rseek.png" height="100" style="margin-left:10px; margin-buttom:10px"></a><br><br><br><br> <a href="https://www.r-bloggers.com/"><img border="0" alt="W3Schools" src="https://raw.githubusercontent.com/therbootcamp/therbootcamp.github.io/master/_sessions/_image/rbloggers.png" height="105" style="margin-bottom:10px"></a><br> <a href="https://stackoverflow.com/"><img border="0" alt="W3Schools" src="https://raw.githubusercontent.com/therbootcamp/therbootcamp.github.io/master/_sessions/_image/stackoverflow.png" height="105"></a> </p> ] --- .pull-left3[ # Thank you ] .pull-right5[ <p align="center"><br> <a href="http://i.imgur.com/PgtvQar.png"><img border="0" alt="W3Schools" src="http://i.imgur.com/PgtvQar.png" height="560"></a><br> <font size = 4> source <a href="http://i.imgur.com/PgtvQar.png"> reddit.com</a> </p> ]