John Little (@libjohn) & Joel Herndon (@herndonj) 2018-08-21
-
Code
-
Repo -- Intro2R repo
This repository contains supporting datasets and files for our Intro to R workshop by the Data & Visualization Services Department, Duke University Libraries. You can find more information about our future and past workshops
-
our guide can be found at our Rfun site
-
More on R (then, scroll down to "R Learning Resources".) Includes video captures
-
Unzip/expand the zipped repo as a folder in your Documents Directory
-
Launch RStudio
-
File > New Project...
-
Existing Directory: Browse to your unzipped copy in the documents directory
- Literate Coding: brief explanation
- New Code Chunk: Ctrl+Alt+I
- R Markdown: brief explanation
library(tidyverse)
- Literate Coding: brief explanation
-
Load & View Tibble (data frame)
-
Data Structure & Data Types (brief)
-
dplyr
-- part of tidyversefilter
rowsarrange
rows by variablesselect
columnsmutate
derive cells / new variablescount
column totalssummarize
grouping reports
-
Now You Try It. Hands on exercises.
-
Basic Exploratory Data Analysis
- Read in new datasets
library(skimr)
-
More
dplyr
-- join two datasetsleft_join
to merge data
-
More Visualize with
ggvis
(syntactically simpler than ggplot2, but...)- Basic visualization (Scatter Plot, Box Plot, Histogram, Bar Chart)
- Take the ggplot2 workshop, or see the materials
- Resource: https://rfun.library.duke.edu/intro2r/visualization.html
-
Our Training Materials
-
R we having fun yet‽ https://rfun.library.duke.edu. Training materials for R.
- 2018 Workshops: Intro to 2 / Visualization / Shiny / Mapping / Git / R Markdown
-
Full DVS workshop series
-
-
Questions: Walk-in schedule and by appointment Data Science Consulting
Shareable via Creative Commons: CC-BY-NC