Data Wrangling and Visualization with Tidyverse Assignment

Download Solution Order New Solution

Assignment Task

In this assignment, you will get to put your newly acquired skills of data wrangling and some visualization into use, by benefiting from the tidyverse ecosystem.

Prerequisites

  • This assignment assumes that you have worked through all materials up to the last week.
  • Make sure you are familiar with this content.
  • In some questions, maybe, you need to search additional functionalities from tidyverse packages

Packages

This assignment will use the following packages:

  • tidyverse: a collection of packages for doing data analysis in a “tidy” way
  • ggplot2: a package that contains the function for the grammer of graphics
  • lubridate: a package for formatting dates in R (in case if you need)

We use the library() function to load packages. In your R Markdown document you should see an R chunk labelled loadpackages which has the necessary code for loading both packages.

Airbnb listings in Edinburgh

Airbnb is an online marketplace where people can book shortterm stays in hotels or in other people’s houses. Recent developments in Edinburgh regarding the growth of Airbnb and its impact on the housing market means a better understanding of the Airbnb listings is needed. Using data provided by Airbnb, we can explore how Airbnb availability and prices vary by neighbourhood.

A copy of the Edinburgh Airbnb data set has been available (because of dsbox package version problem in Rstudio). To read this data, ensure that you have the following code near the beginning of your R Markdown file, from your directory having the data file (ie. data/).

You can view the dataset as a spreadsheet using the View() function. Note that you should not put this function in your R Markdown document, but instead type it directly in the Console, as it pops open a new window. When you run this in the console, you will see the following data viewer window pop up.

  • You can find out more about the dataset by inspecting its documentation, which you can access by running ?edibnb in the Console or using the Help menu in RStudio to search for edibnb (If you can install and call dsbox package correctly).
  • Otherwise, you can also find this information heree.

The edibnb data set contain 13245 listings in Edinburgh, with values about 10 different variables that includes the property neighborhood location, number of rooms and review ratings.

Edinburgh council collects the second data set from their assessments of a randomly selected sample of listings. The variables in this data set are: - id, the ID number of the listing (according to edibnb) - rating, the council’s rating of the listing of the property either being good, adequate or poor. assessment_date, the date the council performed their assessment of the property.

The data is contained in the file council_assessments.csv within the data/ directory. It can be loaded into your workflow using the following code (or any other directory name that you have instead of /data).

Exercise

1.i. In the edibnb data set, what is the ID of the listing that has the highest number of reviews with a perfect review score of 100%?

ii. Which variables have the missing observations in the edibnb data set.

iii. Visualize the missing observations using some functions from visdat or naniar packages (Notes from Week 4 might be useful)

2. Calculate the minimum, maximum and average price from the Airbnb properties in Southside for a single night stay for four people (Try to use the summarise function).

3. When looking at the data you will notice that some of the listings have a value for the number of bathrooms that is not a whole number, e.g. 1.5 or 2.5.

  • Mutate the bathrooms variable to round the number of bathrooms up to the nearest whole number (hint, look at ceiling()).
  • Using this mutated variable, how many listings have more bathrooms than bedrooms?

4. Join the edibnb to the council data frames. Create a bar plot of the neighbourhood variable for the properties that have been assessed by the council (remember to iterate the data visualization to make it as informative as possible).

  • What does the data visualization suggest?
  • Is the council targeting all neighborhoods within Edinburgh equally?

This Data Science has been solved by our PhD Experts at My Uni Paper.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.