Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ccs-amsterdam/r-course-material

A collection of R tutorials
https://github.com/ccs-amsterdam/r-course-material

Last synced: about 2 months ago
JSON representation

A collection of R tutorials

Awesome Lists containing this project

README

        

readme

h1 {font-size: 34px;}
h1.title {font-size: 38px;}
h2 {font-size: 30px;}
h3 {font-size: 24px;}
h4 {font-size: 18px;}
h5 {font-size: 16px;}
h6 {font-size: 12px;}
code {color: inherit; background-color: rgba(0, 0, 0, 0.04);}
pre:not([class]) { background-color: white }

code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}

code{white-space: pre;}

if (window.hljs) {
hljs.configure({languages: []});
hljs.initHighlightingOnLoad();
if (document.readyState && document.readyState === "complete") {
window.setTimeout(function() { hljs.initHighlighting(); }, 0);
}
}

.main-container {
max-width: 940px;
margin-left: auto;
margin-right: auto;
}
img {
max-width:100%;
}
.tabbed-pane {
padding-top: 12px;
}
.html-widget {
margin-bottom: 20px;
}
button.code-folding-btn:focus {
outline: none;
}
summary {
display: list-item;
}
pre code {
padding: 0;
}

.tabset-dropdown > .nav-tabs {
display: inline-table;
max-height: 500px;
min-height: 44px;
overflow-y: auto;
border: 1px solid #ddd;
border-radius: 4px;
}

.tabset-dropdown > .nav-tabs > li.active:before {
content: "";
font-family: 'Glyphicons Halflings';
display: inline-block;
padding: 10px;
border-right: 1px solid #ddd;
}

.tabset-dropdown > .nav-tabs.nav-tabs-open > li.active:before {
content: "";
border: none;
}

.tabset-dropdown > .nav-tabs.nav-tabs-open:before {
content: "";
font-family: 'Glyphicons Halflings';
display: inline-block;
padding: 10px;
border-right: 1px solid #ddd;
}

.tabset-dropdown > .nav-tabs > li.active {
display: block;
}

.tabset-dropdown > .nav-tabs > li > a,
.tabset-dropdown > .nav-tabs > li > a:focus,
.tabset-dropdown > .nav-tabs > li > a:hover {
border: none;
display: inline-block;
border-radius: 4px;
background-color: transparent;
}

.tabset-dropdown > .nav-tabs.nav-tabs-open > li {
display: block;
float: none;
}

.tabset-dropdown > .nav-tabs > li {
display: none;
}


R course material


This page contains a collection of R tutorials, developed at the Vrije Universiteit Amsterdam for Communication Science courses that use R.


The goal is to organize relevant material into modular components, for more efficient design and maintenance of material, that can be used across courses, and that are accessible to students during and after their studies.


Below we list the relevant handouts/tutorials. Each links to the md file, see the Rmd file with the same name for the source code of the tutorials.





Data mangling in the tidyverse


This is a set of tutorials designed to teach using the tidyverse functions for data cleaning, reshaping, visualizing etc. The chapter numbers are relevant chapters from the excellent (and freely available) book “R for Data Scientists” (R4DS)

Handout
Video Tutorial
R4DS ch.
Core packages / functions

Fun with R
Fun with R
3
tidyverse,ggplot2,igraph

R Basics
Intro to R
4
(base R functions)

Transforming Data
Importing and Cleaning
5
dplyr: filter, select, arrange, mutate

Summarizing Data
Grouping and Summarizing
5
dplyr: group_by, summarize

Visualizing Data
ggplot 1
7
ggplot2

Reshaping data
Reshaping
12
tidyr: spread, gather

Combining (merging) Data
Joining
13
dplyr: inner_join, left_join, etc.

Basic string (text) handling

14
readr: str_detect, str_extract etc., iconv



Statistical Analysis


This is a set of tutorials designed to teach basic statistical modeling and analysis. The first tutorial includes examples for standard regression analysis as well as analysis of variance. Later tutorials exemplify the use of more advanced statistical modelling approaches including the generalized linear model and multilevel models.

Tutorial
Video tutorial
Core packages / functions

Basic statistics
Basic stats
stats: lm, aov, t.test

Advanced statistics overview
see GLM and Multilevel
stats: glm, lme4: lmer, glmer

Generalized linear models
GLM (on family argument)
stats: glm, family, sjPlot: tab_model, plot_model

Multilevel Models
Multilevel
lme4: lmer, glmer, sjPlot: tab_model, plot_model



Test theory and factor analysis


The following tutorials can be used to teach basics of test theory and particularly confirmatory and exploratory factor analysis approaches.

Tutorial
Video tutorial
Core packages / functions

Test Theory and Confirmatory Factor Analysis
CFA in R
psych: describe, mardia; lavaan: cfa, fitMeasures, modindices; semTools: reliability

Exploratory Factor Analysis
EFA in R
psych: describe, mardia, fa.parallel, nfactors, fa, fa.diagram, omega




Data collection

Tutorial
Video tutorial
Core packages / functions

Gathering Data

tidyverse, jsonlite

Webscraping with rvest
Web scraping in R
rvest



Note on installing packages


In general, most R packages can be installed without any issues. However, there are some exceptions that you need to know about. For quanteda (that we use in the text analysis tutorials), your computer needs certain software that is not always installed, as mentioned on the quanteda website. You can either install this software, but we rather recommend using R version 4.0.0 (or higher) where this is no longer required. To see your current R version, enter version in your R console. To update, visit the R website (Windows, Mac).


When running install.packages() You sometimes get the message that There is a binary version available but the source version is later (we’re mainly seen this on Mac). You then get the question whether you want to install from sources the package which needs compilation (Yes/no) . To answer this question, you have to type “yes” or “no” in your R console. Most often, you’ll want to say no. Simply put, R tells you that it has a new version of a package, but if you want to use it your computer will need to build it. The problem is that this requires some development software that you might not have installed. If you say no, you’ll install an older version that has already been build for you. In rare cases, installing from source is the only way, in which case you’ll have to install the software that R refers to.



// add bootstrap table styles to pandoc tables
function bootstrapStylePandocTables() {
$('tr.odd').parent('tbody').parent('table').addClass('table table-condensed');
}
$(document).ready(function () {
bootstrapStylePandocTables();
});

$(document).ready(function () {
window.buildTabsets("TOC");
});

$(document).ready(function () {
$('.tabset-dropdown > .nav-tabs > li').click(function () {
$(this).parent().toggleClass('nav-tabs-open');
});
});

(function () {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
document.getElementsByTagName("head")[0].appendChild(script);
})();