Overview - Return values
What is it?
Return values are the results that a function sends back after it finishes running. When you write a function, you can tell it to give back a value, like a number or text, that you can use later. This helps you reuse code and get answers from your functions. Without return values, functions would just do things but never share their results.
Why it matters
Return values let you get useful results from functions, so you can build programs that solve problems step-by-step. Without return values, you would have to repeat code or guess what a function did, making programs confusing and hard to fix. They make your code cleaner, easier to understand, and more powerful.
Where it fits
Before learning return values, you should know what functions are and how to write them. After mastering return values, you can learn about more advanced topics like function arguments, side effects, and functional programming in R.