Question: Homework 1 : Due 2 / 2 / 2 2 , 1 1 : 5 9 pm Instructions: Place all work into a one -

Homework 1: Due 2/2/22,11:59pm
Instructions:
Place all work into a one-to-two page document. Upload the document onto the Canvas homework page by the due date. Documents must be typed and in one of the following formats: .doc, .docx, or . pdf. Data for completing these problems may be found under the "Files/Homework/Homework 1" page on Canvas.
Working with R: The file Fitness.csv contains information on 417 individuals on how much they exercise ("Exercise"), their marital status ("Married"), and their annual income ("Income").
(a)(1pt) Give the exercise status, the marital status, and the annual income for the 150 th and the 350th individual. Also provide the line or lines of R code that allows you to access this information.
(b)(1pt) Find the marital status of the 20th,41st, and 311th individual. Also provide the line or lines of R code that allows you to access this information.
(c)(1pt) Find the annual income of the 185th,186th,187th,188th, and the 189th individual. Also provide the line or lines of R code that allows you to access this information.
(d)(1pt) Write two lines of code: one that changes the marital status of the 4th observation to "Garlic Bread" and one that changes the annual income of the 6th observation to $25.
(e)(1pt) Write a line of R code that creates a vector named "cooldata" that contains the numbers 9,3, and 7, in that order.
(f)(1pt) Write the two sentences in the "Description" section of the R help file for the sd() function.
Understanding R input: A student writes the following line of R code:
example =c(8,6,-7,5,-30,9,3,-13)
(a)(0.5 pts each) Give the output of the following R commands.
i. example[6]
ii. example[-3]
ii. example c(2,5,6)
iv. example[3:5]
v. example -c(1,6,7)
(b)(0.5pts each) Explain why each of the following commands will throw a warning or error.
i. example [9]
ii. Example[3]
iii. example 1,2,6,7
 Homework 1: Due 2/2/22,11:59pm Instructions: Place all work into a one-to-two

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!