Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

R coding 1. Make another copy of df and name it df2. Each step below should be done on top of df2 processed by all

R coding

1. Make another copy of df and name it df2.

Each step below should be done on top of df2 processed by all previous steps. (You will overwrite df2 rather than df or df1 from now on). Create a new column call price_binned in df2 using cut(...), where each row of df2$price_binned is one of (0,200] (200,400] (400,600] (600,800] (800,1e+03] depending on which bin the price in the same row belongs to.

2. Group the rows in df2 based on "price_binned" and "room_type" Print count(df2) to see the number of instances.

3. Using "summarize" to create a new data frame called summ2 that contains the mean of the number of reviews in each group created in Question2. Name this column in summ2 avg_review. Print summ2 to make sure it looks correct.

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions

Question

What is the purpose of value analysis?

Answered: 1 week ago

Question

Which are non projected Teaching aids in advance learning system?

Answered: 1 week ago

Question

=+management system of the MNE?

Answered: 1 week ago