knitr::opts_chunk$set(echo = F,
warning = F,
message = F,
fig.align = "center")
## Load the required package: tidyverse
library(tidyverse)
## Read in the home_sales_sample.csv file as home_sales
home_sales <- read.csv("home_sales_sample.csv")
The home_sales data set has the information on 1,000 randomly sampled homes that were sold in 2022. There are six variables (columns):
id
: The unique identifier for the home in the data
setsale_date
: the date the home went up for saletown
: the town the home is inassessed_value
: The value of the property assessed by
the town for tax purposessale_amount
: How much the home sold for (in $)residential_type
: If the home is a Condo or
Single FamilyCreate a scatterplot of the sale_amount
by
assessed_value
with the points colored by
residential_type
and partially transparent. Add a straight
trend line. See what the graph should look like in Brightspace.
Save the graph as gg_q1
and display the graph in the
knitted document.
Create the graph seen in question 2 in Brightspace. Save the graph as
gg_q2
and display it in the knitted document.
Using the graph created in question 2, create the graph seen in Brightspace for question three. The colors used for Condo and Single Family are tomato and steelblue, respectively. Make sure to pay close attention to the axes!
Save the graph as gg_q3
and make sure to display it in
the knitted document!
Using gg_q3
, create two graphs, one for Condo and one
for Single Family, in the same plot. Hide the legend.
Since this is the final question, you don’t need to save the graph