# part 1
<- seq(1,511,length.out=23)
p1
# part 2
<- p1[13]
p2
# part 3
<- log(p2, base=2)
p3
# part 4
<- sqrt(p3)
p4
# answer
p4
[1] 2.850449
Do the following:
Create a vector of 23 equally spaced numbers that starts at 1 and ends at 511.
Find the 13th element in the vector from Part 1.
Calculate the base 2 logarithm of the result from Part 2.
Calculate the square root of the result from Part 3.
What is the answer to part 4?
Solution below…
# part 1
<- seq(1,511,length.out=23)
p1
# part 2
<- p1[13]
p2
# part 3
<- log(p2, base=2)
p3
# part 4
<- sqrt(p3)
p4
# answer
p4
[1] 2.850449