Question 2: Using R' built in dataset In this problem, you will be using motor trend car road tests data. R refers to this dataset as mtcars. Before you begin the following questions, please run require(mosaic) #note: this package contains the dataset data(mtcars) a. How many variables does this data set contains? List all of them. b. How many observations are in this data set? c. Run the following and then provide a brief description of the variables hp and vs in this data set. help(mtcars) d. Create a histogram of the drat variable. Provide the R code'you use to generate the histogram and paste-the plot here. e. Run the following: #if you closed RStudio at any point since completing question, you must retun require (mosaic) mean(~mpg|am, data=mtcars) This code computes the average mpg for each Transmission type (0 = automatic, 1 = manual). According to the output, which transmission type has higher average mpg?
Question 2: Using R' built in dataset In this problem, you will be using motor trend car road tests data. R refers to this dataset as tears. Before you begin the following questions, please run require(nosale) anote: this package contains the dataset data(atcars) a. How many variables does this data set contains? List all of them b. How many observations are in this data set? 6. Run the following and then provide a brief description of the variables hp and vs In this data set. help(etcars) d. Create a histogram of the drat variable Provide the code you use to generate the histogram and paste the plot here. a. Run the following: you closed studio at any point since completing question, you must retun require(rosate) meannondata ntcars) This code computes the average mpg for each Transmission type (0 - automatic, 1 manual) According to the output, which transmission type has higher average mpg?
Question 2: Using R' built in dataset In this problem, you will be using motor trend car road tests data. R refers to th
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am