output: html_document

Chart 1

library(readxl) library(tidyverse) library(plotly)

Import ABS Wage Price Index data

wage_raw <- read_excel( “C:/Users/mariy/Downloads/634501.xlsx”, sheet = “Data1”, skip = 9 )

Select the wage series

wage <- wage_raw %>% select(Series ID, A2713849C) %>% rename( Quarter = Series ID, Wage_Index = A2713849C ) %>% filter(!is.na(Wage_Index))

Create chart

p1 <- ggplot( wage, aes( x = Quarter, y = Wage_Index, text = paste( “Quarter:”, Quarter, “
Wage Price Index:”, round(Wage_Index, 1) ) ) ) + geom_line( linewidth = 1.5, colour = “#1f77b4” ) + geom_point( size = 0.8, colour = “#1f77b4” ) + labs( title = “Australians Are Earning More Than Ever”, subtitle = “Wage growth has been steady since 1997, but higher earnings do not necessarily mean Australians are better off”, x = NULL, y = “Wage Price Index (WPI)”, caption = “Source: Australian Bureau of Statistics (ABS), Wage Price Index” ) + theme_minimal(base_size = 14) + theme( plot.title = element_text(face = “bold”), plot.subtitle = element_text(size = 11), axis.title.y = element_text(face = “bold”) )

Interactive chart

ggplotly(p1, tooltip = “text”)

Chart 2

library(readxl) library(tidyverse) library(plotly)

—————————–

CPI DATA

—————————–

cpi_raw <- read_excel( “C:/Users/mariy/Downloads/6401017.xlsx”, sheet = “Data1”, skip = 9 )

cpi <- cpi_raw %>% select(Series ID, A2325846C) %>% rename( Quarter = Series ID, CPI = A2325846C ) %>% filter(!is.na(CPI))

—————————–

WAGE DATA

—————————–

wage_raw <- read_excel( “C:/Users/mariy/Downloads/634501.xlsx”, sheet = “Data1”, skip = 9 )

wage <- wage_raw %>% select(Series ID, A2713849C) %>% rename( Quarter = Series ID, Wage_Index = A2713849C ) %>% filter(!is.na(Wage_Index))

—————————–

MERGE DATA

—————————–

combined <- inner_join( wage, cpi, by = “Quarter” )

—————————–

INDEX BOTH SERIES TO 100

—————————–

combined <- combined %>% mutate( Wage_Indexed = Wage_Index / first(Wage_Index) * 100, CPI_Indexed = CPI / first(CPI) * 100 )

—————————–

CHART 2

—————————–

p2 <- ggplot(combined, aes(x = Quarter)) +

geom_line( aes( y = Wage_Indexed, colour = “Wages” ), linewidth = 1.4 ) +

geom_line( aes( y = CPI_Indexed, colour = “Inflation” ), linewidth = 1.4 ) +

labs( title = “Have Wages Kept Up With Inflation?”, subtitle = “Comparing wage growth and inflation since 1997 (both indexed to 100)”, x = NULL, y = “Index (Base = 100)”, colour = ““, caption =”Source: Australian Bureau of Statistics (ABS)” ) +

scale_colour_manual( values = c( “Wages” = “#1f77b4”, “Inflation” = “#d62728” ) ) +

theme_minimal(base_size = 14) +

theme( plot.title = element_text(face = “bold”), plot.subtitle = element_text(size = 11), axis.title.y = element_text(face = “bold”) )

—————————–

INTERACTIVE CHART

—————————–

ggplotly(p2)

CHART 3

library(readxl) library(tidyverse) library(plotly) library(viridis)

Import housing data

housing_raw <- read_excel( “C:/Users/mariy/Downloads/643201 (1).xlsx”, sheet = “Data1”, skip = 9 )

Select state dwelling stock values

housing <- housing_raw %>% select( Series ID, A83728603C, A83728608R, A83728613J, A83728618V, A83728623L, A83728628X, A83728633T, A83728638C ) %>% rename( Quarter = Series ID, NSW = A83728603C, VIC = A83728608R, QLD = A83728613J, SA = A83728618V, WA = A83728623L, TAS = A83728628X, NT = A83728633T, ACT = A83728638C )

Convert to long format

housing_long <- housing %>% pivot_longer( cols = -Quarter, names_to = “State”, values_to = “Dwelling_Value” )

housing_long\(State <- factor( housing_long\)State, levels = c( “NSW”, “VIC”, “QLD”, “WA”, “SA”, “ACT”, “TAS”, “NT” ) )

Heatmap

p3 <- ggplot( housing_long, aes( x = Quarter, y = State, fill = Dwelling_Value, text = paste( “State:”, State, “
Quarter:”, Quarter, “
Dwelling Value: $”, scales::comma(round(Dwelling_Value,0)), ” million” ) ) ) +

geom_tile() +

scale_fill_viridis_c( option = “plasma”, labels = scales::comma ) +

labs( title = “Australia’s Housing Boom Has Not Been Shared Equally”, subtitle = “Housing wealth has grown across Australia, but the largest gains have occurred in NSW and Victoria”, x = NULL, y = NULL, fill = “$ Millions”, caption = “Source: Australian Bureau of Statistics (ABS)” ) +

theme_minimal(base_size = 14) +

theme( plot.title = element_text(face = “bold”), plot.subtitle = element_text(size = 11), axis.text.x = element_text(angle = 45, hjust = 1) )

ggplotly( p3, tooltip = “text” )

Chart 4

library(tidyverse) library(plotly)

ABS Housing Occupancy and Costs (2019-20)

housing_costs <- data.frame( Tenure = c( “Owner without mortgage”, “Owner with mortgage”, “Total renters”, “Private landlord” ), Cost_Percent = c( 3.0, 15.5, 19.9, 20.2 ) )

Order bars from highest burden to lowest

housing_costs <- housing_costs %>% arrange(Cost_Percent)

p4 <- ggplot( housing_costs, aes( x = reorder(Tenure, Cost_Percent), y = Cost_Percent, text = paste( “Housing tenure:”, Tenure, “
Housing costs:”, Cost_Percent, “% of income” ) ) ) +

geom_col( fill = “#d62728”, width = 0.7 ) +

geom_text( aes(label = paste0(Cost_Percent, “%”)), hjust = -0.2, size = 4 ) +

coord_flip() +

expand_limits(y = 22) +

labs( title = “Renters Face Australia’s Highest Housing Costs”, subtitle = “Share of gross household income spent on housing, 2019–20”, x = NULL, y = “Housing Costs (% of Household Income)”, caption = “Source: ABS Housing Occupancy and Costs, Australia 2019–20” ) +

theme_minimal(base_size = 14) +

theme( plot.title = element_text(face = “bold”), plot.subtitle = element_text(size = 11), axis.title.y = element_blank(), panel.grid.minor = element_blank() )

ggplotly( p4, tooltip = “text” )

CHART 5

library(readxl) library(tidyverse) library(plotly)

table13 <- read_excel( “C:/Users/mariy/Downloads/1. Housing occupancy and costs, Australia, 1994–95 to 2019–20 (1).xlsx”, sheet = “Table 1.3” ) tenure <- data.frame( Housing_Type = c( “Owner without mortgage”, “Owner with mortgage”, “Total renters” ), Year_1994_95 = as.numeric(table13[c(9,10,15), 3][[1]]), Year_2019_20 = as.numeric(table13[c(9,10,15), 18][[1]]) )

tenure_long <- tenure %>% pivot_longer( cols = -Housing_Type, names_to = “Year”, values_to = “Percentage” ) %>% mutate( Year = recode( Year, “Year_1994_95” = “1994–95”, “Year_2019_20” = “2019–20” ) )

Reorder categories

tenure_long\(Housing_Type <- factor( tenure_long\)Housing_Type, levels = c( “Owner without mortgage”, “Owner with mortgage”, “Total renters” ) ) # Create chart p5 <- ggplot( tenure_long, aes( x = Housing_Type, y = Percentage, fill = Year, text = paste( “Housing Type:”, Housing_Type, “
Year:”, Year, “
Percentage:”, Percentage, “%” ) ) ) +

geom_col( position = position_dodge(width = 0.9) ) +

geom_text( aes(label = paste0(round(Percentage, 1), “%”)), position = position_dodge(width = 0.9), vjust = -0.3, size = 4 ) +

labs( title = “Home Ownership Is Becoming Harder to Achieve”, subtitle = “Outright home ownership has declined, while renting and mortgage ownership have become more common.”, x = NULL, y = “Percentage of Households”, fill = “” ) +

theme_minimal(base_size = 14) +

theme( plot.title = element_text(face = “bold”), axis.text.x = element_text( angle = 15, hjust = 1 ) )

Interactive chart

ggplotly( p5, tooltip = “text” )