Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Working with R: The file Fitness.csv contains information on 4 1 7 individuals on how much they exercise ( Exercise ) , their

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 208th and the 417th 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 6th, the 106th, and the 406th 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 325th,326th,327 th,328th, and the 329 th individual.
(d)(1pt) Write two lines of code: one that changes the marital status of the 3rd observation to "Broccoli" and one that changes the annual income of the 5 th observation to $1,000,000.
(e)(1pt) Write a line of R code that creates a vector named "cooldata" that contains the numbers 6,1, and 3, 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(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
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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions

Question

Language in Context?

Answered: 1 week ago