Professional Documents
Culture Documents
#AND Operator
j<-c(7,0,FALSE,3+4i)
Print(s&j)
#OR Operator
m<-c(8,0,FALSE,3+4i)
Print (s|m)
#NOT Operator
Print (!s)
#LOGICAL AND
j<-c(9,2,FALSE,2+3i)
Print(s&&j)
#LOGICALOR
Print (s||j)
Sol: #AND Operator
> print(s&j)
#OR Operator
#LOGICAL AND
> s<-c(5,1,TRUE,2+3i)
> j<-c(9,2,FALSE,2+3i)
> print(s&&j)
[1] TRUE
> #LOGICALOR
[1] TRUE
SUMMARY, VARIANCE, MEAN, HEAD, TAIL
Mean (rock$area) #to find the mean of the area in rock dataset
Var (rock$area) #to find the variance of the area in rock dataset
1st Qu.: 5305 1st Qu.:1414.9 1st Qu.:0.16226 1st Qu.: 76.45
3rd Qu.: 8870 3rd Qu.:3989.5 3rd Qu.:0.26267 3rd Qu.: 777.50
Mean (rock$area) #to find the mean of the area in rock dataset
[1] 7187.729
> Var (rock$area) #to find the variance of the area in rock dataset
[1] 7203045