In [1]:
print("Hello World !")
[1] "Hello World !"
In [2]:
print("Hello World !")
print("Hello World !")
print("Hello World !")
print("Hello World !")
print("Hello World !")
[1] "Hello World !" [1] "Hello World !" [1] "Hello World !" [1] "Hello World !" [1] "Hello World !"
In [4]:
print("Itronix Solutions",quote=FALSE)
[1] Itronix Solutions
In [6]:
print("Hello World 1")
#print("Hello World !")
#print("Hello World !")
#print("Hello World !")
print("Hello World 5")
[1] "Hello World 1" [1] "Hello World 5"
In [11]:
Var = 10
print(Var)
[1] 10
In [12]:
Var <- 20
print(Var)
[1] 20
In [13]:
20 -> Var
print(Var)
[1] 20
In [20]:
x <- 28
print(x)
print(class(x))
[1] 28 [1] "numeric"
In [26]:
x <-10L
print(x)
print(class(x))
print(typeof(x))
[1] 10 [1] "integer" [1] "integer"
In [27]:
x <- "Itronix Solutions"
print(x)
print(class(x))
print(typeof(x))
[1] "Itronix Solutions" [1] "character" [1] "character"
In [28]:
x <- TRUE
print(x)
print(class(x))
print(typeof(x))
[1] TRUE [1] "logical" [1] "logical"
In [29]:
x <- 2+5i
print(x)
print(class(x))
print(typeof(x))
[1] 2+5i [1] "complex" [1] "complex"
In [30]:
x <- charToRaw("Hello")
print(x)
print(class(x))
print(typeof(x))
[1] 48 65 6c 6c 6f [1] "raw" [1] "raw"
In [33]:
x=readline()
print(x)
Itronix Solutions [1] "Itronix Solutions"
In [36]:
x=readline(prompt="Enter any String:")
y=readline(prompt="Enter any String:")
z=readline(prompt="Enter any String:")
print(x)
print(y)
print(z)
typeof(x)
typeof(y)
typeof(z)
Enter any String:10 Enter any String:3.14 Enter any String:Itronix [1] "10" [1] "3.14" [1] "Itronix"
‘character’
‘character’
‘character’
In [38]:
x=readline(prompt="Enter any String:")
print(x)
typeof(x)
x=as.integer(x)
print(x)
typeof(x)
Enter any String:10 [1] "10"
‘character’
[1] 10
‘integer’
In [ ]: