- 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:

推薦閱讀
- Getting Started with Clickteam Fusion
- WordPress Theme Development Beginner's Guide(Third Edition)
- Embedded Programming with Modern C++ Cookbook
- Implementing AWS:Design,Build,and Manage your Infrastructure
- PostgreSQL 10 Administration Cookbook
- Hands-On Reactive Programming with Reactor
- Building a BeagleBone Black Super Cluster
- Visual Studio 2010 (C#) Windows數(shù)據(jù)庫(kù)項(xiàng)目開(kāi)發(fā)
- 30天學(xué)通Java Web項(xiàng)目案例開(kāi)發(fā)
- 人工智能云平臺(tái):原理、設(shè)計(jì)與應(yīng)用
- Appcelerator Titanium Smartphone App Development Cookbook(Second Edition)
- CPLD/FPGA技術(shù)應(yīng)用
- 歐姆龍CP1系列PLC原理與應(yīng)用
- OSGi原理與最佳實(shí)踐
- 淘寶網(wǎng)店頁(yè)面設(shè)計(jì)、布局、配色、裝修一本通