Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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!

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

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

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Database Theory And Application Bio Science And Bio Technology International Conferences DTA And BSBT 2011 Held As Part Of The Future Generation In Computer And Information Science 258

Authors: Tai-hoon Kim ,Hojjat Adeli ,Alfredo Cuzzocrea ,Tughrul Arslan ,Yanchun Zhang ,Jianhua Ma ,Kyo-il Chung ,Siti Mariyam ,Xiaofeng Song

2011th Edition

3642271561, 978-3642271564

More Books

Students also viewed these Databases questions