Skip to content

dlab-berkeley/R-Data-Wrangling-Legacy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data Wrangling and Manipulation in R

Workshop Goals

It is often said that 80% of data analysis is spent on the process of cleaning and preparing the data. This workshop will introduce tools (notably dplyr and tidyr) that makes data wrangling and manipulation much easier. Participants will learn how to use these packages to subset and reshape data sets, do calculations across groups of data, clean data, and other useful stuff.

Prior experience with R is helpful. We recommend that students feel comfortable with the skills taught in R Fundamentals. Students who complete this workshop will be well prepared for the D-Lab's advanced data wrangling offerings.

Installation Instructions

We will use RStudio to go through the workshop materials, which requires installation of both the R language and the RStudio software.

  1. Download R: Follow the links according to the operating system that you are running. Download the package, and install R onto your compute. You should install the most recent version (at least version 4.1).

  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.

  3. Download these 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 are familiar with git, you can instead clone this repository by opening a terminal and entering

  5. Make sure that the following packages are installed on your computer

fs
here
tibble
tidyverse

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-Data-Wrangling folder that you downloaded.

  3. Open the R-Data-Wrangling.Rproj by double clicking to open the code in an R project.

  4. Open up the file corresponding to the part of the workshop currently in focus.

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

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

Is R not working on your laptop?

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

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 necessary 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 advanced-data-wrangling-in-R folder.

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 R Workshops

Here are other R workshops offered by the D-Lab:

Basic Competency

Intermediate/Advanced Competency

Contributors

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages