TubEdu

Use functions to customize figures in R


Listen Later

Using functions, we can easily change many functions at once. I use this when writing reports, and there are many plots of the same type that should look alike. By using a function, I avoid repeating myself in the code, and it's easy to adjust the plots later.

Useful is the get() command, which identifies a variable in a dataset. Once the code works with a temporary variable, I wrap it up with a function: bplot = function(myvar) {...}

With functions, I'm not scared if somebody asks for additional plots.

00:00 Introduction

00:47 Create a function
02:00 Why

...more
View all episodesView all episodes
Download on the App Store

TubEduBy