Event box

Intermediate R: Best Practices for Writing R Scripts

Intermediate R: Best Practices for Writing R Scripts In-Person / Online

This intermediate R workshop is all about making it easier to run, reuse, and share R code by writing scripts! We'll cover what scripts are, how to organize code in a script, how to make scripts executable, how to handle inputs and outputs, and how to resuse functions from one script in another. In order to make sure you and others you share your scripts with can run them, we'll also cover how to manage installed packages and their versions with R's built-in functions and the "renv" package. The workshop will end with a brief discussion of what to do next if you want to turn your scripts into fully-fledged R packages.

This workshop is NOT an introduction to R and is intended for motivated intermediate to advanced learners from all domains at UC Davis who want to hone their R skills. Please make sure you meet the prerequisites before registering as we will be unable to answer introductory R questions during this session. (Want to brush up on R? Check out the R Basics 4-part introductory series in DataLab's workshop archive.)

 

After completing this workshop, you should be able to:

  • Create executable R scripts;
  • Organize scripts according to best practices;
  • Modify scripts to accept input via command line arguments;
  • Modify code to log output to the console or a file;
  • Create loops to run repetitive or iterative code;
  • Use R's built-in functions to maintain installed packages;
  • Use the "renv" package to control package versions;

 

Prerequisites

Participants must have taken DataLab’s “R Basics” workshop series and/or have prior experience using R, be comfortable with basic R syntax, and have R and RStudio pre-installed and running on their laptops.

 

Can't make it to this training? Check out upcoming workshop schedule. Recordings of prior similar workshops are also available in DataLab's training archive.

Date:
Tuesday, January 30, 2024
Time:
10:00am - 12:00pm
Time Zone:
Pacific Time - US & Canada (change)
Location:
DataLab Classroom (Shields Library room 360) (Map )
Campus:
Davis Campus
Categories:
  DataLab Workshop  
Registration has closed.

Event Organizer

Profile photo of UC Davis DataLab
UC Davis DataLab

More events like this...