library(readxl) library(tidyverse) library(plotly)
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))
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”) )
ggplotly(p1, tooltip = “text”)
library(readxl) library(tidyverse) library(plotly)
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_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))
combined <- inner_join( wage, cpi, by = “Quarter” )
combined <- combined %>% mutate( Wage_Indexed = Wage_Index / first(Wage_Index) * 100, CPI_Indexed = CPI / first(CPI) * 100 )
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”) )
ggplotly(p2)
library(readxl) library(tidyverse) library(plotly) library(viridis)
housing_raw <- read_excel( “C:/Users/mariy/Downloads/643201 (1).xlsx”, sheet = “Data1”, skip = 9 )
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 )
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” ) )
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” )
library(tidyverse) library(plotly)
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 ) )
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” )
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” ) )
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 ) )
ggplotly( p5, tooltip = “text” )