Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases And Python Programming MySQL MongoDB OOP And Tkinter

Authors: R. PANNEERSELVAM

1st Edition

9357011331, 978-9357011334

More Books

Students also viewed these Databases questions

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago