Course
Introduction to Writing Functions in R
Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.Loved by learners at thousands of companies
Training 2 or more people?
Try DataCamp for BusinessCourse Description
Prerequisites
Introduction to the TidyverseIntermediate RHow to Write a Function
All About Arguments
Return Values and Scope
Case Study on Grain Yields
Complete
Earn Statement of Accomplishment
Add this credential to your LinkedIn profile, resume, or CVShare it on social media and in your performance reviewEnroll Now
FAQs
What will I gain from learning to write my own R functions?
Writing your own functions makes analyses more readable, reduces errors, and increases reusability across projects. It is considered the single biggest productivity boost for R programmers.
What real-world datasets are used in the exercises?
You will work with data on Wyoming tourism, stock price-to-earnings ratios, and grain yields to practice writing practical data science functions in realistic contexts.
Does the course explain how R handles variable scope?
Yes. Chapter 3 covers how R decides which variables exist and are accessible, including return values, early returns, and returning multiple values from a function.
What R prerequisites do I need?
You should have completed Introduction to R, Intermediate R, and Introduction to the Tidyverse. Comfort with vectors, data frames, and dplyr pipelines is expected.
Is there a capstone project in this course?
Yes. The final chapter is a case study on grain yields where you apply your function writing skills to data preparation, visualization, and modeling tasks.
Join over 19 million learners and start Introduction to Writing Functions in R today!
Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.Grow your data skills with DataCamp for Mobile
Make progress on the go with our mobile courses and daily 5-minute coding challenges.