
上QQ阅读APP看书,第一时间看更新
Data types
You need to have brief idea about basic data types and structures in R in order to grasp all the recipies in book. This section will give you an overview for the same and make you ready for using R. R supports all the basic data types supported by any other programming and scripting language. In simple words, data can be of numeric, character, date, and logical type. As the name suggests, numeric means all type of numbers, while logical allows only true and false. To check the type of data, the class function, which will display the class of the data, is used.
Perform following task on R Console or RStudio:
> x=123 > class(x) Output: [1] "numeric"
> x="ABC"
> class(x)
Output:
[1] "character"