+ - 0:00:00
Notes for current slide
Notes for next slide

Next steps

The R Bootcamp
Twitter: @therbootcamp

April 2018

1 / 21

Next steps

What we would have liked to cover
1. Networks
2. Bayesian stats
3. Text analysis
4. Statistics
5. Rcpp
6. Forms
7. Github
8. R on servers

How to continue
8. Books
9. Websites R
10. Groups
2 / 21

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.

3 / 21

Semantic networks - www.swow.me

4 / 21

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 and twitter.com.

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.
5 / 21

Text analysis: Applications - hedonometer.org


Link to Paper
View Vonnegut's Shape of Stories

7 / 21

Stats packages

"If there is a new statistical method, it is first implemented in R"
-- duw


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.
8 / 21

Deep learning

9 / 21

Deep learning: Tensorflow

# 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')

10 / 21

Bayesian statistics

Recent years several convenient and efficient packages for Bayesian statistics have been developed, facilitating a shift to a more informative and consistent statistical framework.
Using these packages is oftentimes as easy as using their Frequentist counterparts. See in particular the BayesFactor package.



source labtimes.org

# load package
library(BayesFactor)
# define data
x <- rnorm(100, 0, 1)
y <- rnorm(100, 1, 1)
# run Frequentist analysis
t.test(x, y)
# run Bayesian analysis
ttestBF(x, y)
## Warning: package 'Matrix' was built under R version 3.4.4
## Bayes factor analysis
## --------------
## [1] Alt., r=0.707 : 5914249 ±0%
##
## Against denominator:
## Null, mu1-mu2 = 0
## ---
## Bayes factor type: BFindepSample, JZS
11 / 21

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 avaialble a collection free, peer-reviewed C++ libraries, and RcppArmdillo, which available the high-performance Armadillo library for linear algebra methods.

12 / 21

Google Forms & Maps

New packages also allow you to interact with Google Maps and Google Forms. Use ggmap to access Google Maps and googlesheets to access Google Forms.

library(ggmap)
ggmap(get_map(c(7.588576, 47.559601),zoom=16))



13 / 21

Github & Dropbox

An important part of programming is to keep track of the progress to potential be able to go back to an earlier version of the code. To achieve this, many programmers rely on version-control software such as GitHub. R and, in particular, RStudio work have inbuilt software that allow you to sync your project with an GitHub repository. Via the package called rdrop2, R also interfaces with the popular cloud service Dropbox, which also allows for rudimentary version control.

14 / 21

R on servers

With the need for more computing power for, e.g., machine learning, R is also moving more and more to the server and cluster sphere. Rstudio offers a convenient (and free) solution to access RStudio sessions on a remote linux server via a browser. RStdudio also offers the sparklyr package integrating the Spark architecture for efficient cluster computing with dplyr. Other packages exist to interface with Hadoop (RHadoop) and SQL (RSQLite).

15 / 21

How to continue

  1. Practice
  2. Read books
  3. Consult websites
  4. Attend R group
  5. Get consulting


W3Schools

16 / 21

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.

W3Schools W3Schools W3Schools W3Schools W3Schools W3Schools W3Schools W3Schools
W3Schools W3Schools W3Schools W3Schools W3Schools W3Schools W3Schools W3Schools

17 / 21

Websites

The web is a great place to learn about R.

Best begin your journey with:

Google or Rseek, 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.

Then you will most likely be redirected to one of two pages

R-bloggers is a website on which R users inform each other on the newest developments. See, e.g., Nathaniel's entry.

Stackoverflow is a website on which R users exchange problems and solutions to problems. Try post something yourself. You will be amazed by the turnaround.










W3SchoolsW3SchoolsW3Schools



W3Schools
W3Schools

18 / 21

R meetup groups

Great place to meet other R enthusiast in and outside of industry and see interesting presentions on R's latest developments.

W3Schools

W3Schools

19 / 21

Consulting

Feel free to contact us.


W3Schools

Dr. Dirk Wulff

dirkwulff.org
github.com/dwulff
packages: cstab,
mousetrap, choicepp


W3Schools

Dr. Nathaniel Phillips

nathanieldphillips.com
github.com/ndphillips
packages: yarrr,
FFTrees


W3Schools

Markus Steiner

github.com/mdsteiner
package: ShinyPsych


20 / 21

Thank you


W3Schools
source reddit.com

21 / 21

Next steps

What we would have liked to cover
1. Networks
2. Bayesian stats
3. Text analysis
4. Statistics
5. Rcpp
6. Forms
7. Github
8. R on servers

How to continue
8. Books
9. Websites R
10. Groups
2 / 21
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow