From the course: R for Data Science: Lunch Break Lessons

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Look inside

Look inside

- [Instructor] Sometimes it's helpful to be able to examine the inside of a function to find out what the programmer intended or maybe some of the hidden features that a programmer has placed inside. So let's take a minute to look at how you can examine the inside and return values of functions. I've already installed the CalSAVE package and then we can play with it a little bit. You'll recall that say is a function from CalSAVE, and I can say, say good morning (keys clacking) by a cat, (keys clacking) and when I hit return I get a cat that says good morning. Very convenient. But what is actually going on inside of say? And the way that you can do that is just simply typing in the function without the parentheses and when I hit return, what you'll see is the actual code is being run when I type in say. In this case here's the function definition, what=Hello world, by=cat, type=message and the code then that uses those parameters. (keys clacking) Now there are other functions we can…

Contents