HW 1: due 1159 pm Wednesday Feb 3, via Canvas January 28, 2021 1. Every morning I eat breakfast and then run over the Queensboro Bridge (1.33 miles). Here is data for the past week (Monday to Sunday)...

I will need a price lower than $30 to get this done.


HW 1: due 1159 pm Wednesday Feb 3, via Canvas January 28, 2021 1. Every morning I eat breakfast and then run over the Queensboro Bridge (1.33 miles). Here is data for the past week (Monday to Sunday) on how many hours I slept the previous night, what I had for breakfast, and how many minutes it took me to run over the bridge that day. 8, 6, 3, 4, 9, 8.5, 12 oatmeal, bananas, eggs, bananas, eggs, oatmeal, eggs 11, 12, 10, 14, 15, 10.5, 15 (a) Create four vectors i. One named daysofweek which contains the names of the days of the week. First element, for example, is Monday. ii. One named hoursslept which contains the number of hours I slept the previous night. First element, for example, is 8. iii. One named breakfast which contains the type of breakfast I ate that day. First element, for example, is oatmeal. iv. One named runtime which contains the minutes it took me to run. First element, for example, is 11. (b) From the vectors you have created above: i. create a vector firstdaysbfasts which contains the breakfasts I ate on the first three days of the week. ii. create a vector lastdaysbfasts which contains the breakfasts I ate on the last four days of the week. iii. create a vector wellfedruntimes which contains my run times on days on which I ate oatmeal for breakfast. It is NOT enough to say “give me the first and sixth element of runtime”. Your code must work no matter what the elements of runtime and breakfast are. iv. create a vector restedruntimes which contains my run times on days on which I slept more than 7 hours. v. create a vector wellfedandrestedruntimes which contains my run times on days on which I ate oatmeal for breakfast and slept more than 7 hours. 1 vi. create a vector hungryortiredruntimes which contains my run times on days on which I EITHER ate bananas for breakfast OR I slept less than 7 hours. (c) What is the average time it took me to run on days on which I have slept more than 7 hours? Put this average in an object named averagerestedruntimes. (d) What did I eat for breakfast on the day I ran my fastest? Put that word in an object named bestbreakfastforrunning. Note: I know what the best breakfast for running is: I can just look for myself. I want you to do it in R. Your code must solve the problem no matter what the vectors daysofweek, hoursslept etc are. (e) Finally, write a command to save all the objects you have created to a file named week1hwobjects.Rdata. Submission instructions You will submit only one text file. Do NOT submit any .Rdata files. Create a text file named hwweek1.txt. Put all your commands in that file. The first line of the file should read rm(list=ls()) If I copy and paste your commands into my R window, it should run with no errors and produce a file in my directory named week1hwobjects.Rdata. Upload this file to the assignment on Canvas. Starting week 3, if your code gives me errors when I run it, I will not check your assignment and you will get no credit. For the first two weeks I will check it and tell you if I encountered problems. There are points for following instructions, so please be careful. 2
Jan 31, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here