Loading & Understanding Data

Author

Josie Griffin ’09

Agenda

This week we’ll be learning how to add our own data from a file to RStudio. Not always as simple as it sounds. In order to do so, you’ll need to know a little about file paths. Then, we’ll talk about how your data is stored in R and what it considers a variable. In doing so we’ll use some basic R functions.

After today you should be able to:

  • load your data files (csv or xlsx into R) by naming the path to the file

  • use project files to avoid having to do the above!

  • know what a variable object is

  • perform some basic operations (like sum, mean, etc) on variables

Packages to load:

To use commands from specific packages they must first be loaded using the command library(package_name). If you have not installed the package you will first need to run install.packages("package_name"). You only need to install once, but you need to load a library each time you start a new script.

  • {tidyverse} or {readr}

This workshop is part of a series. If you would like to see previous workshops or see the topics of future workshops, please check the workshop schedule.

If you have questions beyond what is covered in the workshops, please feel free to contact Josie at either griffinj@reed.edu or data@reed.edu.

You can also drop in to the open hours at the DataLab for help with R or any other quantitative subject!