Read the following instructions carefully 1. The full mark of this test is 10 points, contributing to 8% of the final grade. 2. Submit the assignment to our digital learning platform 24 hours before...

1 answer below »
Read the following instructions carefully 1. The full mark of this test is 10 points, contributing to 8% of the final grade. 2. Submit the assignment to our digital learning platform 24 hours before the next synchronous session. 3. All submitted work must be typeset, saved in either Microsoft .docx or Adobe .pdf format. 4. In the assignment, number all questions, sections, and subsections clearly. 5. Use a page break a new page for each question. In Microsoft Word, you can press Ctrl + Enter to add a page break. 6. Save the file as “Fist Last Assignment##”. For example, “Ken Chui Assignment01.docx”. 7. Unless being told otherwise, ˆ report all up to three significant figures, round up. E.g. Report 12.358 as “12.4” and 0.0025477 as “0.00255”. Scientific notation is also allowed: 2.55 × 10-3 . ˆ show your mathematical works, if applicable. ˆ show your R syntax codes in monospace font type (e.g. Courier New), if applicable. 8. You are allowed to work in groups to discuss how to approach the questions, but the answer should be written individually. Do not share typed or written answers. 9. You are also encourage to post questions on Piazza.com. Remember to tag the question with the the “assignment” tag. HIA 226: Data Wrangling HIA 226 Assignment 02 Page 2 of 3 R competency The “R competency” questions cover some of what we covered in the video lectures. You may use this as a test of your comprehension. 1. For this question we will need to use the Auto data set that comes with the ISLR package. First, let us do a one-time installation of the ISLR package if your current R does not have it: install.packages("ISLR") Then we can make a copy of the data, calling it auto2: library(ISLR) auto2 75,] Combine the two above, write a line of code that would display the variables name and cylinders, where the number of cylinders are small than 4 or bigger than 6. Show your codes. (f) [2 points] Create a data set called auto3, which retains all the variables and cars with the miles per gallon bigger or equal to the average of mpg in the original data set. Show your codes. FUN FACT: You can do this without actually knowing what the mean mpg is! HIA 226: Data Wrangling HIA 226 Assignment 02 Page 3 of 3 2. [1 point (bonus)] Display the data auto2 showing only 6-cylinder car(s) built after 1975 with horsepower greater than 150. Show your codes. End of the assignment Remember to name this file as “First Last Assignment##” using your first name, last name, and assignment number. Submit it through the learning management system.
Answered Same DaySep 23, 2021

Answer To: Read the following instructions carefully 1. The full mark of this test is 10 points, contributing...

Nithin answered on Sep 24 2021
127 Votes
install.packages("ISLR")
library(ISLR)
auto2 <- Auto
? Auto
#1
typeof(Auto$origin)
#2
auto2$o
rigin <- as.factor(auto2$origin)
typeof(auto2$origin)
table(auto2$origin)
#3
max(auto2$year)
min(auto2$year)
#4
auto2$year4 <- 1900 + auto2$year
#5
auto2[auto2$cylinders<2 |...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here