There are different data types in R, such as character, numeric, and logical. These three are the most important data types in R. When creating a function in R, the mix of data types could create a problem and eventually the result will not be as expected. In this recipe, you will learn how to check the data types inside a function and how to convert them if necessary.
Handling data types in input arguments
Getting ready
In this recipe, you will write the same function as you wrote in the previous recipe, Writing functions with multiple arguments and use of default values of this chapter. The fDescriptive function takes one numeric vector as input and one character vector as the second input. In this recipe, you will write...