#a Add three different numbers together
2+4+3
## [1] 9
#a Subtraction of 1 number from anothernumber
9-1
## [1] 8
#a Multiplication of 2 different numbers
2*3
## [1] 6
#a Division of one number from another
6/2
## [1] 3
#a Raising a number to the 4th power
4^4
## [1] 256
#a Take the 3rd root of a number
6^(1/3)
## [1] 1.817121
#a log to the base 10 of a number
x <-(2)
log10(2)
## [1] 0.30103
#b Enter a vector of 6 numbers into an object, c, using assignment operator, <-.
c <- c(2,3,4,5,8,7)
c(c)
## [1] 2 3 4 5 8 7
#C Print the 3rd element of c.
c[c(3)]
## [1] 4
#d Print the length of vector(c)
mylist <- list (1:10)
#e Enter into a matrix in which the first row contains numbers 1,3,5,7 and 2nd row contains 2,4,6,8
d<- c (1,3,5,7,2,4,6,8)
d
## [1] 1 3 5 7 2 4 6 8
#[1]1 2 3 4 5 6 7 8
dim = matrix(1:8,2,4)
d
## [1] 1 3 5 7 2 4 6 8
#f Assign to F the addition of 5 to each element in d. Print F.
f <- 5 +d
f
## [1] 6 8 10 12 7 9 11 13
#g Print the dimemsion of matrix F.
dim(f)
## NULL
#h Assign 5.25 to k and "frank" to m.#i Check k and m to determine data type
k <- 5.25
k
## [1] 5.25
m <-"frank"
m
## [1] "frank"
class(k)
## [1] "numeric"
k
## [1] 5.25
class(m)
## [1] "character"
#j comvert k to integer and assign the result to p.Print p to the console.
k<- as.integer(k)
k
## [1] 5
p<-5
#convert
k<- as.character(k)
# k assign to G the conversion of k to a character. Add 5.1 to G. Explain what happens and why.
G<- k
G
## [1] "5"
# Add 5.1 to G.What happens and why.
# [1] 5.1 numeric value, G is a character