• Stars
    star
    139
  • Rank 262,954 (Top 6 %)
  • Language
    R
  • License
    Other
  • Created about 8 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

D-Lab's 12 hour introduction to R Fundamentals. Learn how to create variables and functions, manipulate data frames, make visualizations, use control flow structures, and more, using R in RStudio.

D-Lab's R Fundamentals Workshop

Datahub Binder

This repository contains the materials for D-Lab's R Fundamentals workshop. No prior experience with R is required.

Workshop Goals

This interactive workshop series is your complete introduction to programming in R for people with little or no previous programming experience. It covers the basics of using RStudio, creating variables, working with data frames, and starting to analyse your data using summary statistics and data visualization.

Learning Objectives

After completing this workshop series you will be able to:

  • Navigate R Studio
  • Open data in R and work with it in data frames using tidyverse
  • Distinguish between different variable types
  • Visualize data using ggplot
  • Inspect documentation to deal with error messages

This workshop does not cover the following:

Workshop Structure

R Fundamentals has 4 parts. Each of the parts takes 2 hours, and is delivered in a lecture-style coding walk through interrupted by challenge problems and a break. Instructors and TAs are dedicated to engaging you in the classroom and answering questions in plain language.

  1. Part 1: Introduction to R and R Studio
  2. Part 2: Data frames and variable types
  3. Part 3: Manipulating data frames
  4. Part 4: Data visualizations and custom functions

Installation Instructions

RStudio is a software commonly used by R practitioners to develop code in R. We will use RStudio to go through the workshop materials, which requires the installation of both the R language and the RStudio software. If you would like to run R on your own computer, complete the following steps prior to the workshop:

  1. Download R: Follow the links according to the operating system you are running. You will first need to click on a link corresponding to your operating system, and then an additional link to select a specific version of R. Download the package, and install R onto your computer. You should install the most recent version (at least version 4.1).

    • If you are using a Mac, click "Download R for macOS" and then select the right version of R. You will need to select the version corresponding to your specific version of macOS, as well as whether you have an Intel or Apple Silicon Mac.
    • If you are using Windows, click "Download R for Windows", then click "base", and click the download link.
    • If you are using Linux, click on the link corresponding to your Linux distribution, and then follow the instructions.
  2. Download RStudio: Install RStudio Desktop. This should be free. Do this after you have already installed R. The D-Lab strongly recommends an RStudio edition of 2022.02.0+443 "Prairie Trillium" or higher.

    • Some individuals with older operating systems may run into odd issues. If you are running into issues with the installation of RStudio, you may need to install a specific version of RStudio. Please check this link if this applies to you.
  3. Download these R Fundamentals workshop materials:

    • Click the green "Code" button in the top right of the repository information.
    • Click "Download Zip".
    • Extract this file to a folder on your computer where you can easily access it (we recommend Desktop).
  4. Optional: if you're familiar with git, you can instead clone this repository by opening a terminal and entering git clone [email protected]:dlab-berkeley/R-Fundamentals.git.

Is R not working on your laptop?

If you do not have R installed and the materials loaded on your workshop by the time it starts, we strongly recommend using the UC Berkeley DataHub to run the materials for these lessons. You can access the DataHub by clicking the following button:

DataHub

Some users may have to click the link twice if the materials do not load initially.

The DataHub downloads this repository, along with any necessary packages, and allows you to run the materials in an RStudio instance on UC Berkeley's servers. No installation is needed from your end - you only need an internet browser and a CalNet ID to log in. By using the DataHub, you can save your work and come back to it at any time. When you want to return to your saved work, go straight to DataHub, sign in, and click on the R-Fundamentals folder.

If you don't have a Berkeley CalNet ID, you can still run these lessons in the cloud, by clicking this button:

Binder

If you are loading Binder with this repository for the first time, it may take a few minutes to set up. Binder operates similarly to the D-Lab DataHub, but on a different set of servers. By using Binder, however, you cannot save your work.

Run the Code

Now that you have all the required software and materials, you need to run the code.

  1. Launch the RStudio software.

  2. Use the file navigator to find the R-Fundamentals folder you downloaded from Github. Open R-Fundamentals.Rproj by double clicking on the file.

  3. Open up the file corresponding to the part of the workshop you're attending (Part1.Rmd, Part2.Rmd, Part3.Rmd, Part4.Rmd) via the Files panel in RStudio.

  4. Place your cursor on a given line and press Command + Enter (Mac) or Control + Enter (PC) to run an individual line of code.

  5. The solutions folder contains the solutions to the challenge problems.

Additional Resources

Check out the following online resources to learn more about R:

as well as the following books:

About the UC Berkeley D-Lab

D-Lab works with Berkeley faculty, research staff, and students to advance data-intensive social science and humanities research. Our goal at D-Lab is to provide practical training, staff support, resources, and space to enable you to use R for your own research applications. Our services cater to all skill levels and no programming, statistical, or computer science backgrounds are necessary. We offer these services in the form of workshops, one-to-one consulting, and working groups that cover a variety of research topics, digital tools, and programming languages.

Visit the D-Lab homepage to learn more about us. You can view our calendar for upcoming events, learn about how to utilize our consulting and data services, and check out upcoming workshops.

Other D-Lab [Language] Workshops

D-Lab offers a variety of R workshops, catered toward different levels of expertise.

Basic Competency

Intermediate/Advanced Competency

Contributors

Provide a list of contributors here, with links to their webpages (D-Lab or private).

More Repositories

1

Computational-Social-Science-Training-Program

This course is a rigorous, year-long introduction to computational social science. We cover topics spanning reproducibility and collaboration, machine learning, natural language processing, and causal inference. This course has a strong applied focus with emphasis placed on doing computational social science.
Jupyter Notebook
218
star
2

Machine-Learning-in-R

Workshop (6 hours): preprocessing, cross-validation, lasso, decision trees, random forest, xgboost, superlearner ensembles
CSS
187
star
3

Python-Fundamentals-Legacy

D-Lab's 12 hour introduction to Python. Learn how to create variables and functions, use control flow structures, use libraries, import data, and more, using Python and Jupyter Notebooks.
Jupyter Notebook
168
star
4

Bash-Git

D-Lab's 3 hour introduction to basic Bash commands and using version control with Git and Github.
131
star
5

R-Deep-Learning

Workshop (6 hours): Deep learning in R using Keras. Building & training deep nets, image classification, transfer learning, text analysis, visualization
R
120
star
6

git-fundamentals

A starting point for discovering the wonderful world of Git, GitHub, and Git Annex (Assistant)
Shell
74
star
7

Stata-Fundamentals

D-Lab's 9 hour introduction to performing data analysis with Stata. Learn how to program, conduct data analysis, create visualization, and conduct statistical analyses in Stata.
Stata
72
star
8

python-for-everything

Materials for teaching the Python for Everything workshop at UC Berkeley's D-lab
Jupyter Notebook
69
star
9

Python-Machine-Learning

D-Lab's 6 hour introduction to machine learning in Python. Learn how to perform classification, regression, clustering, and do model selection using scikit-learn in Python.
Jupyter Notebook
66
star
10

MachineLearningWG

D-Lab's Machine Learning Working Group at UC Berkeley, with supervised & unsupervised learning tutorials in R and Python
HTML
65
star
11

Python-Geospatial-Fundamentals-Legacy

D-Lab's 6 hour introduction to working with geospatial data in Python. Learn how to import, visualize, and analyze geospatial data using GeoPandas in Python.
Jupyter Notebook
57
star
12

Python-Data-Visualization-Legacy

D-Lab's 3 hour introduction to data visualization with Python. Learn how to create histograms, bar plots, box plots, scatter plots, compound figures, and more, using matplotlib and seaborn.
Jupyter Notebook
56
star
13

R-Geospatial-Fundamentals-Legacy

This is the repository for D-Lab's Geospatial Fundamentals in R with sf workshop.
Jupyter Notebook
53
star
14

Python-Data-Wrangling-Legacy

D-Lab's 3 hour introduction to data wrangling in Python. Learn how to import and manipulate dataframes using pandas in Python.
Jupyter Notebook
51
star
15

R-Machine-Learning-Legacy

D-Lab's 6 hour introduction to machine learning in R. Learn the fundamentals of machine learning, regression, and classification, using tidymodels in R.
R
47
star
16

Unsupervised-Learning-in-R

Workshop (6 hours): Clustering (Hdbscan, LCA, Hopach), dimension reduction (UMAP, GLRM), and anomaly detection (isolation forests).
R
47
star
17

python-berkeley

python resources of berkeley curated at a place
Jupyter Notebook
44
star
18

Python-Text-Analysis-Fundamentals

D-Lab's 9 hour introduction to text analysis with Python. Learn how to perform bag-of-words, sentiment analysis, topic modeling, word embeddings, and more, using scikit-learn, NLTK, gensim, and spaCy in Python.
Jupyter Notebook
38
star
19

R-Data-Wrangling-Legacy

D-Lab's 6 hour introduction to data wrangling with R. Learn how to manipulate dataframes using the tidyverse in R.
R
37
star
20

python-data-from-web

API and web scraping workshops
Jupyter Notebook
35
star
21

R-Data-Visualization-Legacy

D-Lab's 3 hour introduction to data visualization with R. Learn how to create histograms, bar plots, box plots, scatter plots, compound figures, and more using ggplot2 and cowplot.
28
star
22

R-Functional-Programming

The joy and power of functional programming in R
27
star
23

python-text-analysis-legacy

Text Analysis Workshops for UC Berkeley's D-Lab
Jupyter Notebook
26
star
24

programming-fundamentals

Introduction to Programming for UC Berkeley's D-Lab
Python
23
star
25

ANN-Fundamentals

Jupyter Notebook
23
star
26

DIGHUM101-2020

Jupyter Notebook
20
star
27

Python-Text-Analysis

D-Lab's 12 hour introduction to text analysis with Python. Learn how to perform bag-of-words, sentiment analysis, topic modeling, word embeddings, and more, using scikit-learn, NLTK, Gensim, and spaCy in Python.
Jupyter Notebook
20
star
28

sql-for-r-users

SQL for R Users, Workshop
HTML
19
star
29

Python-Deep-Learning-Legacy

D-Lab's 6 hour introduction to deep learning in Python. Learn how to create and train neural networks using Tensorflow and Keras.
Jupyter Notebook
17
star
30

awesome-dlab

😎 Awesome lists about all kinds of topics and tools interesting to D-Labbers
17
star
31

advanced-data-wrangling-in-R-legacy

Advanced-data-wrangling-in-R, Workshop
HTML
15
star
32

R-Census-Data-Legacy

Workshop on fetching and mapping census data with tidycensus
HTML
14
star
33

Geospatial-Fundamentals-in-QGIS

11
star
34

regular-expressions-in-python

Jupyter Notebook
10
star
35

Qualtrics-Fundamentals

D-Lab's 3 hour introduction to Qualtrics Fundamentals. Learn how to design and manage your own surveys in Qualtrics.
10
star
36

Data-Science-Social-Justice-2022

Materials for D-Lab / UC Berkeley Graduate Division's Data Science + Social Justice summer workshop. These materials provide an introduction to Python, natural language processing, text analysis, word embeddings, and network analysis. They also include discussions on critical approaches to data science to promote social justice.
Jupyter Notebook
10
star
37

Geocoding-in-R

HTML
9
star
38

Python-Data-Wrangling

D-Lab's 3-hour workshop diving deep into Pandas. Learn how to manipulate, index, merge, group, and plot data frames using Pandas functions.
Jupyter Notebook
9
star
39

efficient-reproducible-project-management-in-R

Efficient and Reproducible Project Management in R
HTML
9
star
40

Excel-Fundamentals

D-Lab's six-hour introduction to the basics of Microsoft Excel (with support materials for Google Sheets). Learn Excel functions for handling text, math, dates, logic, and calculations; learn to create charts and pivot tables.
9
star
41

fairML

Bias and Fairness in ML workshop
Jupyter Notebook
8
star
42

Python-Web-Scraping-Legacy

D-Lab's 3 hour introduction to web scraping in Python. Learn how to use APIs and scrape data from websites using the New York Times API and BeautifulSoup in Python.
Jupyter Notebook
7
star
43

regex-intro

Shell
6
star
44

Geospatial-Fundamentals-in-R-sp

HTML
6
star
45

Leaflet-Maps-in-R

A 3-hour intensive workshop to introduce the R Leaflet package
HTML
6
star
46

javascript-viz

A D-Lab intro to JavaScript visualization using the IPython notebook.
HTML
6
star
47

DIGHUM101-2023

Practicing the Digital Humanities, UC Berkeley Summer Session 2023
Jupyter Notebook
6
star
48

LaTeX-Fundamentals

TeX
6
star
49

DIGHUM101-2021

Jupyter Notebook
5
star
50

cloud-computing-working-group

5
star
51

data-security-fundamentals

Data Security Fundamentals
HTML
5
star
52

Python-Fundamentals

D-Lab's 3-part, 6 hour introduction to Python. Learn how to create variables, distinguish data types, use methods, and work with Pandas, using Python and Jupyter.
Jupyter Notebook
4
star
53

Python-Web-APIs

D-Lab's 2 hour introduction to using web APIs in Python. Learn how to obtain data from web platforms using the New York Times API as a case study.
Jupyter Notebook
3
star
54

quick-consulting-examples

Collection of quick pandas, python, and other coding examples based on real consulting requests.
Jupyter Notebook
3
star
55

dlab-berkeley.github.io

Tech overview site showcasing D-Lab's online offerings
CSS
3
star
56

visualization-in-Excel

3
star
57

Python-Web-Scraping

D-Lab's 2 hour introduction to web scraping in Python. Learn how to scrape HTML/CSS data from websites using Requests and Beautiful Soup.
Jupyter Notebook
3
star
58

Data-Science-Social-Justice

Materials for D-Lab / UC Berkeley Graduate Division's Data Science for Social Justice summer workshop. These materials provide an introduction to Python, natural language processing, text analysis, word embeddings, and network analysis. They also include discussions on critical approaches to data science to promote social justice.
Jupyter Notebook
3
star
59

DIGHUM101-2022

Practicing the Digital Humanities, UC Berkeley Summer Session 2022
Jupyter Notebook
3
star
60

Python-Geospatial-Fundamentals

About D-Lab's 4-hour introduction to working with geospatial data in Python. Learn how to import, visualize, and analyze geospatial data in Python.
Jupyter Notebook
2
star
61

Basics-of-Excel

2
star
62

intro-maxqda

2
star
63

Python-Intermediate

D-Lab's 3-part, 6 hour workshop diving deeper into Python. Learn how to create functions, use if-statements and for-loops, and work with Pandas, using Python and Jupyter.
Jupyter Notebook
2
star
64

R-Data-Visualization

D-Lab's 2-hour introduction to data visualization with R. Learn how to create histograms, bar charts, box plots, scatter plots, and more using ggplot2.
R
2
star
65

IRB-Fundamentals

D-Lab's 3 hour introduction to the fundamentals of navigating Institutional Review Boards (IRB).
2
star
66

RStudio-Project-Management

Resources to help you start managing data science projects.
HTML
1
star
67

git-for-project-management

Using Git and GitHub for Project Management
1
star
68

R-package-development

R package development workshop
HTML
1
star
69

Git-Playground

This repository is for D-Lab workshops that require practicing with Git.
1
star
70

sas-intro

Introduction to SAS
TeX
1
star
71

R-Push-Ins

D-Lab's 4.5 hour "push-in" introduction to R, providing a brief survey of foundational R concepts and operations.
R
1
star
72

DEVP229-Spring2021

HTML
1
star
73

MAXQDA-Fundamentals

D-Lab's 2 hour introduction to MAXQDA. Learn how to conduct qualitative data analysis using MAXQDA.
1
star
74

sas-analysis

Data Analysis with SAS
SAS
1
star
75

R-Research-Design

1
star
76

ArcGIS-Online-Fundamentals

1
star
77

dlab-methods

CSS
1
star
78

Computational-Text-Analysis-2017

An introduction to Computational Text Analysis in four 2hr sessions designed to help beginners build intuition, and to interact with workflows for natural language processing, supervised, and unsupervised approaches. Created for CTAWG in 2017 by Ben Gebre-Medhin
HTML
1
star
79

Python-Data-Visualization-Pilot

D-Lab's 4-hour introduction to data visualization with Python. Learn how to create histograms, bar plots, box plots, scatter plots, compound figures, and more, using matplotlib and seaborn.
Jupyter Notebook
1
star
80

HAAS-Python-Workshop

Jupyter Notebook
1
star