NEP -R PROGRAMMING

PROGRAM 1 PROGRAM 2 PROGRAM 3 PROGRAM 4 PROGRAM 5 PROGRAM 6 PROGRAM 7 PROGRAM 8 PROGRAM 9 PROGRAM 10

PART B

PROGRAM B1 PROGRAM B2 PROGRAM B3 PROGRAM B4 PROGRAM B5 PROGRAM B6 PROGRAM B7 PROGRAM B8 . . .

 
  
 
 
 #Write an R program that includes variables, constants, and data types.



# A simple R program-----------------
# to illustrate Numeric data type

# Assign a decimal value to x
x = 5.6

# print the class name of variable
print(class(x))

# print the type of variable
print(typeof(x))



# Complex ------------------
# to illustrate complex data type

# Assign a complex value to x
x = 4 + 3i

# print the class name of x
print(class(x))

# print the type of x
print(typeof(x))




#   Assign a character value to char
char = "Geeksforgeeks"

# print the class name of char
print(class(char))

# print the type of char
print(typeof(char))



#  data type of an object

# Logical
print(class(TRUE))

# Integer
print(class(3L))

# Numeric
print(class(10.5))

# Complex
print(class(1+2i))

# Character
print(class("12-04-2020"))


#   variables

# using equal to operator
var1 = "hello"
print(var1)

# using leftward operator
var2 <- "hello"
print(var2)

# using rightward operator
"hello" -> var3
print(var3)