Home Python C Language C ++ HTML 5 CSS Javascript Java Kotlin SQL DJango Bootstrap React.js R C# PHP ASP.Net Numpy Dart Pandas Digital Marketing

R Number


Certainly! In R, numbers are values that represent numerical quantities. Here's a simple explanation with examples:

Numeric Numbers:

Numeric numbers in R can be integers (whole numbers) or decimals (floating-point numbers).

Integers:

Integers are whole numbers without any decimal or fractional part.

Example

x <- 10

Decimals (Floating-Point Numbers):

Decimals, also known as floating-point numbers, are numbers with a decimal point.

Example

y <- 3.14

Checking the Data Type:

You can use the class() function to check the data type of a number.

Example

class(x) # This will return "numeric"
class(y) # This will also return "numeric"

Mathematical Operations:

You can perform various mathematical operations on numbers in R, such as addition, subtraction, multiplication, and division.

Example

# Addition
3 + 5

# Subtraction
10 - 2

# Multiplication
4 * 6

# Division
20 / 5

Numbers are fundamental in R for performing calculations, storing quantities, and representing numerical data.


Advertisement





Q3 Schools : India


Online Complier

HTML 5

Python

java

C++

C

JavaScript

Website Development

HTML

CSS

JavaScript

Python

SQL

Campus Learning

C

C#

java