Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab: Manipulating Data frames The dataframe is one of the most essential data structures used in R. It is conceptually equivalent to a database relation

image text in transcribed
Lab: Manipulating Data frames The "dataframe\" is one of the most essential data structures used in R. It is conceptually equivalent to a database \"relation" and to the typical rectangular dataset with variables as columns and cases as rows. For this activity, you will gain some skill with manipulating a dataframe. Task 1: R offers several built-in dataframes: For this activity we will use the "mtcars" dataset that contains 1 1 variables and 32 cases representing different models of cars. The goal is to create a new variable for this dataframe that represents the engine displacement per cylinder in cubic inches for each vehicle. You may not know what displacement is [or maybe even cylinders]; but it will suffice to know that values in the column named "disp" divided by values in the column named "cyl" will yield the appropriate quantity. One fundamental principle of working with data is that you should never overwrite or change your original raw data. Therefore, your very rst line of code should be: my_mtcars ( mtcars # Copy original dataframe into a new one From that point forward you can work on my_mtcars without mucking up the original data. Also note that in order to establish that you have completed the assignment correctlyJ your last command should summarize your new variable using the summary function. The output of that nal command should look exactly like this: Min. let Qu. Median Mean 3rd Qu. Max. 17.?T 26.92 34.48 35.03 43.19 59.00

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

Numerical Analysis

Authors: Richard L. Burden, J. Douglas Faires

9th edition

538733519, 978-1133169338, 1133169333, 978-0538733519

More Books

Students also viewed these Mathematics questions

Question

8.2 Why is product management essential?

Answered: 1 week ago