Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q10. Elements of an R data frame can also be accessed the same way elements of a matrix are accessed using subscripts. Subsets of a

image text in transcribed
Q10. Elements of an R data frame can also be accessed the same way elements of a matrix are accessed using subscripts. Subsets of a data frame extracted this way will themselves be data frames, except when they are single rows, columns, or scalars. In general, a single row will be a data frame and a single column, an R vector Load the package named MASS and the Cars93 data set available in the package using data (Cars93, package-"MASS"). Use subscripting operations on Cars93 to find the vehicles with highway mileage of less than 25 miles per gallon (variable MPG.highway) and weight (variable Weight) over 3500 lbs. Report the model name, the price range (low, high), highway mileage, and the weight of the cars that satisfy these conditions. This can be done in a single R expression; however, you may simplify the extraction to several steps Q10. Elements of an R data frame can also be accessed the same way elements of a matrix are accessed using subscripts. Subsets of a data frame extracted this way will themselves be data frames, except when they are single rows, columns, or scalars. In general, a single row will be a data frame and a single column, an R vector Load the package named MASS and the Cars93 data set available in the package using data (Cars93, package-"MASS"). Use subscripting operations on Cars93 to find the vehicles with highway mileage of less than 25 miles per gallon (variable MPG.highway) and weight (variable Weight) over 3500 lbs. Report the model name, the price range (low, high), highway mileage, and the weight of the cars that satisfy these conditions. This can be done in a single R expression; however, you may simplify the extraction to several steps

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

Databases A Beginners Guide

Authors: Andy Oppel

1st Edition

007160846X, 978-0071608466

More Books

Students also viewed these Databases questions