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.