Week 1 Lab

Author

Alyssa Hargis

Problem 1

3*4+7-8/13
[1] 18.38462
exp(-3)
[1] 0.04978707
100^(1/4)
[1] 3.162278
log(15.8)
[1] 2.76001
sin(pi/6)
[1] 0.5

Problem 2

x=3
y=2

Y is not found because only lowercase ‘y’ has been assigned a variable.

Problem 3

vector_01=seq(3,21,2)
vector_01
 [1]  3  5  7  9 11 13 15 17 19 21

Problem 4

lab_vector= c(3,6,3.141593654, 3+4i)
lab_vector
[1] 3.000000+0i 6.000000+0i 3.141594+0i 3.000000+4i

The code 3+4i produces a complex data type.

Problem 5

set.seed(1)
height=round(rnorm(100,
                   mean=172,
                   sd=10),digits = 1)
height
  [1] 165.7 173.8 163.6 188.0 175.3 163.8 176.9 179.4 177.8 168.9 187.1 175.9
 [13] 165.8 149.9 183.2 171.6 171.8 181.4 180.2 177.9 181.2 179.8 172.7 152.1
 [25] 178.2 171.4 170.4 157.3 167.2 176.2 185.6 171.0 175.9 171.5 158.2 167.9
 [37] 168.1 171.4 183.0 179.6 170.4 169.5 179.0 177.6 165.1 164.9 175.6 179.7
 [49] 170.9 180.8 176.0 165.9 175.4 160.7 186.3 191.8 168.3 161.6 177.7 170.6
 [61] 196.0 171.6 178.9 172.3 164.6 173.9 154.0 186.7 173.5 193.7 176.8 164.9
 [73] 178.1 162.7 159.5 174.9 167.6 172.0 172.7 166.1 166.3 170.6 183.8 156.8
 [85] 177.9 175.3 182.6 169.0 175.7 174.7 166.6 184.1 183.6 179.0 187.9 177.6
 [97] 159.2 166.3 159.8 167.3