Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started