#1. Do the following calculations in R
a<-(5*4)^(4*5)-56

a
## [1] 1.048576e+26
b<-23-1*(8-12)

b
## [1] 27
c<-56/8*(3+4)

c
## [1] 49
d<-45-5*8+(8+9)

d
## [1] 22
#2. Create the following vectors a, b, and c

a<-c(2,5,6,7)

a
## [1] 2 5 6 7
b<-c(1,0,9,8)

b
## [1] 1 0 9 8
c<-c(6,5,8,3)

c
## [1] 6 5 8 3
#3. Matrix

mat<-matrix(c(a,b,c), nrow=3, ncol=4)

mat
##      [,1] [,2] [,3] [,4]
## [1,]    2    7    9    5
## [2,]    5    1    8    8
## [3,]    6    0    6    3
mat1<-rbind(mat)

mat1
##      [,1] [,2] [,3] [,4]
## [1,]    2    7    9    5
## [2,]    5    1    8    8
## [3,]    6    0    6    3
colnames(mat1)<-c("Mon", "Tue", "Wed", "Thu")

rownames(mat1)<-c("Present", "Absent", "On Leave")

mat1
##          Mon Tue Wed Thu
## Present    2   7   9   5
## Absent     5   1   8   8
## On Leave   6   0   6   3
rowsum<-rowSums(mat1)

rowsum
##  Present   Absent On Leave 
##       23       22       15
colsum<-colSums(mat1)

colsum
## Mon Tue Wed Thu 
##  13   8  23  16