Question: A student writes the following line of R code: example = c ( 1 , 5 , - 4 , 3 , - 2 ,

A student writes the following line of R code:
example = c(1,5,-4,3,-2,8,13,-2)
(a)(0.5 pts each) Give the output of the following R commands.
i. example[5]
ii. example[-3]
iii. example[c(1,4,5)]
iv. example[2:4]
v. example[-c(3,6,7)]
(b)(0.5pts each) Explain why each of the following commands will throw an error.
i. Example[5]
ii. example[9]
iii. example[1,3,5,6]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!