- R Programming Fundamentals
- Kaelen Medeiros
- 116字
- 2021-07-23 16:58:20
Numeric and Integers
The numeric data class includes all numbers except integers, which are their own separate class in R. Anything of class numeric will be of type double, unless it is explicitly declared as an integer. To create an integer, you must type a capital letter, L, after a whole number.
Let's now create and check the class() and typeof() of different numeric objects in R. Follow the steps given below:
- Create the following numeric objects:
x <- 12.7
y <- 8L
z <- 950
- Check the class and type of each using class() and typeof(), respectively, as follows:
class(x)
typeof(x)
class(y)
typeof(y)
class(z)
typeof(z)
Output: The preceding code provides the following output:

推薦閱讀
- Visualforce Development Cookbook(Second Edition)
- 軟件架構設計
- Spark編程基礎(Scala版)
- JBoss ESB Beginner’s Guide
- 統(tǒng)計策略搜索強化學習方法及應用
- Ceph:Designing and Implementing Scalable Storage Systems
- 菜鳥起飛系統(tǒng)安裝與重裝
- Dreamweaver CS6精彩網(wǎng)頁制作與網(wǎng)站建設
- 人工智能技術入門
- SQL Server數(shù)據(jù)庫應用基礎(第2版)
- Mastering OpenStack(Second Edition)
- Xilinx FPGA高級設計及應用
- 手把手教你學Photoshop CS3
- Practical AWS Networking
- Learning iOS 8 for Enterprise