Summer Deals - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
1. Introduction to functions
Creating functions
If statements
Summary

Instruction

In our Introduction to R course, we already talked about the basics of functions. In this part, we'll learn a lot more about functions and write plenty of our own!

A function is a set of reusable instructions that can be called in a script as many times as needed. In Introduction to R, we looked at several built-in functions. We mentioned the list() function, which we use to create lists. You also worked with the data.frame() function, which is used to create data frames. We've also looked at the str() and length() functions.

In this part of the course, we'll learn how to create our own functions and use them in our R code. We'll be working with a dataset of people surveyed from the fictional country of Jesse. This data includes each person's:

  • First name
  • Last name
  • Birthday
  • Answers to job-related questions

Exercise

We'll be working with the survey data set. Display this data set and familiarize yourself with its contents.