Question: R Data Frames Exercises For this exercise we will test your knowledge of data frames! Just follow the exercise instructions that are in bold below!

 R Data Frames Exercises For this exercise we will test yourknowledge of data frames! Just follow the exercise instructions that are inbold below! Ex 1: Recreate the following dataframe by creating vectors andusing the data.frame function: In [3]: Out[3]: Ex 2: Check if mtcars

R Data Frames Exercises For this exercise we will test your knowledge of data frames! Just follow the exercise instructions that are in bold below! Ex 1: Recreate the following dataframe by creating vectors and using the data.frame function: In [3]: Out[3]: Ex 2: Check if mtcars is a dataframe using is.data.frame() In [1]: Out[1]: TRUE Ex 3: Use as.data.frame() to convert a matrix into a dataframe: In [3] : Out [3]: Ex 4: Set the built-in data frame mtcars as a variable df. We'll use this df variable for the rest of the exercises. In [4]: df 20.090625 Ex 7: Select the rows where all cars have 6 cylinders (cyl column) Ex 8: Select the columns am,gear, and carb. Ex 9: Create a new column called performance, which is calculated by hp/wt. In [13]: In [14]: head(df) Out [14]: Ex 10: Your performance column will have several decimal place precision. Figure out how to use round() (check help(round)) to reduce this accuracy to only 2 decimal places. In [16]: In [17]: head(df) Out [17]: Ex 10: What is the average mpg for cars that have more than 100hpAND a wt value of more than 2.5. In [20]: Out [20]: 16.8636363636364 Ex 11: What is the mpg of the Hornet Sportabout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!