Create a new column of the table which calculates the number of ids
Part 2
The online hospitality company Airbnb has made publicly available a number of datasets. This part of the assignment makes use of the listings.csv dataset which is available at
It consists of a number of parameters related to properties available for lodging in the Melbourne metropolitan area and can be visualised at http://insideairbnb.com/melbourne.
Write R code to answer the following.
1. Give the five neighbourhoods with the most listings (list them along with the counts in descending order).
2. How many listings contain the following words (upper or lower case or mixed) in the name column?
a. Beautiful
b. Quiet
c. Amazing
d. <another adjective of your choice with at least 200 instances>
3. How many listings are there with last review in 2016? Give month by month counts for the year 2016.
4. Create a new column of the table which calculates the number of ids that correspond to the given host_id . Your answer will match the calculated_host_listings_count column (only use this column to check your answer).
5. Write a function that inputs a listing id and outputs a score that is the sum of points according to the following criteria:
a. Points for the neighbourhood: (average number of bedrooms per dwelling in 2016) × 50 (this comes from the data set in Part 1)
b. Points for the room type: 200 for Entire home/apt, 100 for Private room, 0 for Shared room
c. Points for minimum nights: 50 for 1 night, 25 for 2 nights, 0 for 3 or more nights
d. Points for availability: (availability_365) divided by 5
e. Points for review frequency: 50 × (reviews per month), but no more than 100
f. Points for price: (300 minus price)
Which id (ids if more than one) has the highest score according to the above system?
Hint
Business "Part 2Question 1The following figures represent the five neighborhood with the most listings.1 Melbourne 7311 2 Port Phillip 2905 3 Yarra 2017 4 Stonnington 1569 5 Moreland 1007Question 2a) There were 448 listings that contained the word beautifulb)There were ...
The following figures represent the five neighborhood with the most listings.
1 Melbourne 7311
2 Port Phillip 2905
3 Yarra 2017
4 Stonnington 1569
5 Moreland 1007
Question 2
a) There were 448 listings that contained the word beautiful
b)There were 247 listings that contained the word quiet
c)There were 262 listings that contained the word amazing
d)There were 233 listings that contained the word sunny
Question 3:
There were 743 listings that with the last reviews for the year 2016
The dataset is not tidy since it doesn’t satisfy the properties of a tidy data which include: each variable is not in its own column, each observation is not in its own row, and each value is not in its own cell."