Assignment 3

Storytelling with Open Data

Pavithra Mani (s3981109)

INTRODUCTION

Understanding Rent Movements as a Measure of Cost Living

DATA OVERVIEW

Overview of the Data set

# Read and clean the dataset
rent_data <- read.csv("/Users/apple/Downloads/R/Rents, annual movement.csv")
names(rent_data) <- trimws(sub("\\.+$", "", gsub("\\.+", " ", names(rent_data))))

# Print cleaned column names to verify
print(colnames(rent_data))
## [1] "Rents annual movement" "Sydney"                "Melbourne"            
## [4] "Brisbane"              "Australia"
# Convert data into a tidy format
rent_data_tidy <- pivot_longer(rent_data, cols = -`Rents annual movement`, names_to = "City", values_to = "Rent_Change")

# Assuming 'Rents annual movement' is the date column and is in a format like "Mar-01", which represents March 2001
rent_data_tidy$`Rents annual movement` <- as.Date(paste0("01-", rent_data_tidy$`Rents annual movement`), format="%d-%b-%y")

# Rename the column to 'Date' for easier referencing
names(rent_data_tidy)[names(rent_data_tidy) == "Rents annual movement"] <- "Date"

VISUALISATION 1: Peak and Trough Analysis of Rent Changes

Comparative Insights into Rental Market Volatility

This bar chart showcases the maximum increases and decreases in rental rates across Sydney, Melbourne, Brisbane, and the overall Australian market. Highlighting both the highest peaks and lowest troughs, the visualization provides a clear view of the extent of rent volatility over the years, aiding stakeholders in understanding the stability and risk within these urban rental markets.

# Calculate max and min rent changes for each city
peak_trough_data <- rent_data_tidy %>%
  group_by(City) %>%
  summarize(
    Max_Increase = max(Rent_Change, na.rm = TRUE),  # Handle missing data
    Max_Decrease = min(Rent_Change, na.rm = TRUE)   # Handle missing data
  ) %>%
  gather(key = "Measure", value = "Rent_Change", Max_Increase, Max_Decrease)  # Pivot data for easier plotting

# Create the bar chart
bar_chart <- ggplot(peak_trough_data, aes(x = City, y = Rent_Change, fill = Measure)) +
  geom_bar(stat = "identity", position = position_dodge(width = 0.5)) +
  labs(title = "Peak and Trough Rent Changes by City",
       x = "City",
       y = "Rent Change (%)") +
  scale_fill_manual(values = c("Max_Increase" = "blue", "Max_Decrease" = "red")) +
  theme_minimal()

# Display the plot
print(bar_chart)

VISUALISATION 2: Heat Map of Rent Changes Across Australian Cities

Visualizing the Intensity of Rental Market Fluctuations

This heat map illustrates the yearly rent changes in Sydney, Melbourne, Brisbane, and the national average, using color gradients to represent the intensity of changes. Blue signifies decreases, white indicates stability, and red highlights increases. The visualization effectively displays patterns of rent volatility, helping to identify trends and anomalies in the rental market over time.

# Create the heat map
heat_map <- ggplot(rent_data_tidy, aes(x = Date, y = City, fill = Rent_Change)) +
  geom_tile() +  # Use geom_tile to create the heat map
  scale_fill_gradient2(low = "blue", mid = "white", high = "red", midpoint = 0, 
                       name = "Rent Change (%)") +  # Color gradient
  labs(title = "Heat Map of Annual Rent Movements",
       x = "Date",
       y = "City") +
  theme_minimal() +
  theme(axis.text.x = element_text(angle = 90, hjust = 1))  # Rotate x-axis labels for better readability

# Display the plot
print(heat_map)

VISUALISATION 3: Tracking Cumulative Rent Changes Over Time

A Comparative Overview of Rent Dynamics in Australian Cities

This stacked area chart depicts the cumulative percentage changes in rent for Sydney, Melbourne, Brisbane, and the national average. By layering each city’s rent changes over time, the chart highlights the overall growth or decline in rental rates, illustrating the long-term trends and the relative impact of economic factors on each city’s rental market.

# Assuming rent_data_tidy is already in the right format with 'Date', 'City', and 'Rent_Change'
# Prepare data for cumulative sum visualization
area_data <- rent_data_tidy %>%
  group_by(City) %>%
  arrange(Date, .by_group = TRUE) %>%
  mutate(Cumulative_Rent_Change = cumsum(Rent_Change))  # Calculate cumulative rent change

# Create the stacked area chart
area_chart <- ggplot(area_data, aes(x = Date, y = Cumulative_Rent_Change, fill = City)) +
  geom_area(alpha = 0.6) +  # Use geom_area for the area plot
  scale_fill_brewer(palette = "Paired") +  # Use a color palette that is distinct and readable
  labs(title = "Cumulative Rent Movement by City",
       x = "Date",
       y = "Cumulative Percentage Change in Rent") +
  theme_minimal()

# Display the plot
print(area_chart)

VISUALISATION 4: Distribution of Annual Rent Changes by City

Analyzing Rent Variability Across Major Cities

This box plot illustrates the distribution of annual rent changes for Sydney, Melbourne, Brisbane, and the Australian average. The plot highlights the median values, variability, and potential outliers, providing a clear view of the differences and similarities in rent dynamics across these cities.

# Create the box plot
box_plot <- ggplot(rent_data_tidy, aes(x = City, y = Rent_Change, fill = City)) +
  geom_boxplot() +
  labs(title = "Distribution of Annual Rent Changes by City",
       x = "City",
       y = "Percentage Change in Rent") +
  theme_minimal() +
  theme(legend.position = "none")  # Remove legend as fill is redundant

# Display the plot
print(box_plot)

CONCLUSION

Summary and Recommendations

REFERENCES

The reference to the original data visualisation choose, the data source(s) used for the reconstruction and any other sources used for this assignment are as follows: