Skip to main content
R Programming
My Courses
College Courses
Professional Courses
My Courses
Chemistry
General Chemistry
Organic Chemistry
Analytical Chemistry
GOB Chemistry
Biochemistry
Intro to Chemistry
Biology
General Biology
Microbiology
Anatomy & Physiology
Genetics
Cell Biology
Math
College Algebra
Trigonometry
Precalculus
Physics
Physics
Business
Microeconomics
Macroeconomics
Financial Accounting
Social Sciences
Psychology
Programming
Introduction to Python
Microsoft Power BI
Data Analysis - Excel
Introduction to Blockchain
HTML, CSS & Layout
Introduction to JavaScript
R Programming
Product & Marketing
Agile & Product Management
Digital Marketing
Project Management
AI in Marketing
Channels Home
Learn
Bookmarks
Table of contents
Skip to main content
Part 1: R as a Tool — Introduction
Worksheet
Introduction
1: Getting Started with R
Worksheet
Learning objectives
1.1 Download and Install R
1.2 Work in the R Environment
1.3 Install and load packages
2: The Basic Building Blocks in R
Worksheet
Learning objectives
2.1 Use R as a calculator
2.2 Work with variables
2.3 Understand the different data types
2.4 Store data in vectors
2.5 Call functions
3: Advanced Data Structures in R
Worksheet
Learning objectives
3.1 Create and access information in data.frames
3.2 Create and access information in lists
3.3 Create and access information in matrices
4: Reading Data into R
Worksheet
Learning objectives
4.1 Read a CSV into R
4.2 Read an Excel Spreadsheet into R
4.3 Read from databases
4.4 Read data files from other statistical tools
4.5 Load binary R files
4.6 Load data included with R
4.7 Scrape data from the web
4.8 Read XML data
5: Making Statistical Graphs
Worksheet
Learning objectives
5.1 Find the diamonds in the data
5.2 Make histograms with base graphics
5.3 Make scatterplots with base graphics
5.4 Make boxplots with base graphics
5.5 Get familiar with ggplot2
5.6 Plot histograms and densities with ggplot2
5.7 Make scatterplots with ggplot2
5.8 Make boxplots and violin plots with ggplot2
5.9 Make line plots
5.10 Create small multiples
5.11 Control colors and shapes
5.12 Add themes to graphs
5.13 Use Web graphics
6: Basics of Programming
Worksheet
Learning objectives
6.1 Write the classic "Hello, World!" example
6.2 Understand the basics of function arguments
6.3 Return a value from a function
6.4 Gain flexibility with do.call
6.5 Use "if" statements to control program flow
6.6 Stagger "if" statements with "else"
6.7 Check multiple statements with switch
6.8 Run checks on entire vectors
6.9 Check compound statements
6.10 Iterate with a for loop
6.11 Iterate with a while loop
6.12 Control loops with break and next
7: Data Munging
Worksheet
Learning objectives
7.1 Repeat an operation on a matrix using apply
7.2 Repeat an operation on a list
7.3 Apply a function over multiple lists with mapply
7.4 Perform group summaries with the aggregate function
7.5 Do group operations with the plyr Package
7.6 Combine datasets
7.7 Join datasets
7.8 Switch storage paradigms
7.9 Use tidyr
7.10 Get faster group operations
8: In-Depth with dplyr
Worksheet
Learning objectives
8.1 Use tbl
8.2 Use select to choose columns
8.3 Use filter to choose rows
8.4 Use slice to choose rows
8.5 Use mutate to change or create columns
8.6 Use summarize for quick computation on tbl
8.7 Use group_by to split the data
8.8 Apply arbitrary functions with do
9: Manipulating Strings
Worksheet
Learning objectives
9.1 Combine strings together
9.2 Extract text
10: Reports and Slideshows with knitr
Worksheet
Learning objectives
10.1 Understand the basics of LaTeX
10.2 Weave R code into LaTeX using knitr
10.3 Understand the basics of Markdown
10.4 Understand the basics of RMarkdown
10.5 Weave R code into Markdown using knitr
10.6 Convert Markdown files to Word
10.7 Convert Markdown to PDF
10.8 Create slideshows with RMarkdown
10.9 Write equations with RMarkdown
11: Include HTML Widgets in HTML Documents
Worksheet
Learning objectives
11.1 Work with datatables of tabular data
11.2 Use rbokeh
11.3 Use Leaflet for mapping
12: Shiny
Worksheet
Learning objectives
12.1 Use shiny objects in a markdown document
12.2 Work with ui.r and server.r files
13: Package Building
Worksheet
Learning objectives
13.1 Understand the folder structure and files in a package
13.2 Write and document functions
13.3 Check and build a package
13.4 Test R code
13.5 Submit a package to CRAN
14: Rcpp for Faster Code
Worksheet
Learning objectives
14.1 Understand the basics of C++ with R
14.2 Write a C++ function for R
14.3 Use Rcpp syntactic sugar
14.4 Sum in C++
14.5 Write a package in R
14.6 Write a package with C++ code
Part 1 - Summary
Worksheet
Part 1: R as a Tool--Summary
Part 2: R for Statistics, Modeling and Machine Learning — Introduction
Worksheet
Introdution
15: Basic Statistics
Worksheet
Learning objectives
15.1 Draw numbers from probability distributions
15.2 Calculate averages, standard deviations and correlations
15.3 Compare samples with t-tests and analysis of variance
16: Linear Models
Worksheet
Learning objectives
16.1 Fit simple linear models
16.2 Explore the data
16.3 Fit multiple regression models
16.4 Fit logistic regression
16.5 Fit Poisson regression
16.6 Analyze survival data
16.7 Assess model quality with residuals
16.8 Compare models
16.9 Judge accuracy using cross-validation
16.10 Estimate uncertainty with the bootstrap
16.11 Choose variables using stepwise selection
17: Other Models
Worksheet
Learning objectives
17.1 Select variables and improve predictions with the elastic net
17.2 Decrease uncertainty with weakly informative priors
17.3 Fit nonlinear least squares
17.4 Use Splines
17.5 Use GAMs
17.6 Fit decision trees to make a random forest
18: Time Series
Worksheet
Learning objectives
18.1 Understand ACF and PACF
18.2 Fit and assess ARIMA models
18.3 Use VAR for multivariate time series
18.4 Use GARCH for better volatility modeling
19: Clustering
Worksheet
Learning objectives
19.1 Partition data with k-means
19.2 Robustly cluster, even with categorical data, with PAM
19.3 Perform hierarchical clustering
20: More Machine Learning
Worksheet
Learning objectives
20.1 Build a recommendation engine with RecommenderLab
20.2 Mine text with RTextTools
20.3 Perform matrix factorization using irlba
21: Network Analysis
Worksheet
Learning objectives
21.1 Get started with igraph
21.2 Read edgelists
21.3 Understand common graph metrics
21.4 Use centrality measures
21.5 Utilize more graph operations
22: Automatic Parameter Tuning with Caret
Worksheet
Learning objectives
22.1 Establish optimal tree depth for rpart
22.2 Choose the best number of trees for a random forest
23: Fit a Bayesian Model with RStan
Worksheet
Learning objectives
23.1 Understand the Stan computing paradigm
23.2 Fit a simple regression model
23.3 Fit a multilevel model with Stan
Part 2 - Summary
Worksheet
Part 2: R for Statistics, Modeling and Machine Learning--Summary
16: Linear Models
Learning objectives
16: Linear Models
Learning objectives
Next Topic: 16.1 Fit simple linear models