Solution Review: Creating Functions
Explore how to define functions in R by using arguments and conditional blocks. Understand the syntax of creating functions, practice making functions that perform tasks based on input, and improve your problem-solving abilities in R programming.
We'll cover the following...
We'll cover the following...
Solution: Creating a Function
Explanation
Create a function using the following syntax:
evenOdd <- function(testVariable)
{
<Conditional Block>
}
The function takes an argument testVariable and accordingly performs some tasks on it.