RTB

setwd("/Users/charten/OneDrive - Glenveagh Properties/Research & Development/1. Analysis/")
GEO_Merge_RIA02 <- readxl::read_xlsx(path="C:\\Users\\charten\\OneDrive - Glenveagh Properties\\Research & Development\\1. Analysis\\GEO_FILES.xlsx",sheet = 3)
GEO_Merge_RIA02$Location <- GEO_Merge_RIA02$Locations_RIA02 
RTB_Exclude <- readxl::read_xlsx(path="C:\\Users\\charten\\OneDrive - Glenveagh Properties\\Research & Development\\1. Analysis\\GEO_FILES.xlsx",sheet = 4)
shp <- sf::read_sf("Constituency_Boundaries_Ungeneralised___OSi_National_Electoral_Boundaries___2017.shp")

RIA02: RTB Average Monthly Rent Report

The series although being named “Monthly” in the database is averaged to years. There are 446 locations in the series, 383 locations will be used in this analysis due to the data including aggregated areas such as counties with granular level towns.

The latest data published for the RTB (RIA02) which includes 2021 data contained revisions to historical data.

RIA02 <- cso_get_data("RIA02")
RIA02 <- RIA02%>%
  pivot_longer(!1:4, names_to = "year")
RIA02 <- merge(GEO_Merge_RIA02, RIA02, by.x = "Location", by.y="Location")
RIA02 <- full_join(RIA02, RTB_Exclude, by = "Location")
# The first iteration to include All Bedrooms, All Property Types
RIA02.1 <- RIA02 %>%
  filter(Number.of.Bedrooms=="All bedrooms")%>%
  filter(Property.Type=="All property types")%>%
  filter(`Excluded (=0)`=="1")

# The second iteration to include [One bed, Two bed, Three bed, Four plus bed], All Property Types
RIA02.2 <- RIA02 %>%
  filter(Number.of.Bedrooms=="One bed"|Number.of.Bedrooms=="Two bed"|Number.of.Bedrooms=="Three bed"|Number.of.Bedrooms=="Four plus bed")%>%
  filter(Property.Type=="All property types") %>%
  filter(`Excluded (=0)`=="1")
  
# The third iteration to include [One bed, Two bed, Three bed, Four plus bed], [Detached house, Semi detached house, Terrace house, Apartment, Other flats]
RIA02.3 <- RIA02 %>%
  filter(Number.of.Bedrooms=="One bed"|Number.of.Bedrooms=="Two bed"|Number.of.Bedrooms=="Three bed"|Number.of.Bedrooms=="Four plus bed")%>%
  filter(Property.Type=="Detached house"|Property.Type=="Semi detached house"|Property.Type=="Terrace house"|Property.Type=="Apartment"|Property.Type=="Other flats") %>%
  filter(`Excluded (=0)`=="1")
# Filter to 2021
RIA02.1_21 <- RIA02.1 %>%
  filter(year=="2021")
RIA02.2_21 <- RIA02.2 %>%
  filter(year=="2021")

T_RIA02.1_21 <- RIA02.1_21 %>%
  group_by(Seat_Tag)%>%
  summarise(nr = n(),
            Avg = mean(value,na.rm=TRUE))
T_RIA02.2_21 <- RIA02.2_21 %>%
  group_by(Seat_Tag,Number.of.Bedrooms)%>%
  summarise(nr = n(),
            Avg = mean(value,na.rm=TRUE))

# Merge the above to map

shpRIA02.1_21<- merge(shp, T_RIA02.1_21, by.x = "CON_SEAT_", by.y="Seat_Tag")
  
T_RIA02.1_21_GDA <- RIA02.1_21 %>%
  group_by(Seat_Tag)%>%
  summarise(nr = n(),
            Avg = mean(value,na.rm=TRUE)) %>%
  filter(grepl('Dublin|Laoghaire|Meath|Louth|Kildare|Wicklow', Seat_Tag))
shpRIA02.1_21_GDA <- merge(shp, T_RIA02.1_21_GDA, by.x = "CON_SEAT_", by.y="Seat_Tag")
#Map
Map_ALL<-shpRIA02.1_21 %>%
  ggplot()+
  geom_sf(aes(fill = Avg))+
  scale_fill_stepsn(n.breaks = 10,
    colors=c("#0c233f","#FFFFFF","#b4862d"),
    limits = c(500,2250),
    name = "Rent")+
    ggtitle('RTB - CSO: RIA02')+
  labs(caption="2021: Locations aggregated to constituency")+
  theme_void()+
  theme(legend.title = element_text(size = 10),
        legend.text = element_text(size = 8))+
    theme(legend.position = "left")+
  theme(plot.title = element_text(hjust = 1))

Map_GDA<-shpRIA02.1_21_GDA %>%
  ggplot()+
  geom_sf(aes(fill = Avg))+
  scale_fill_stepsn(n.breaks = 10,
    colors=c("#0c233f","#FFFFFF","#b4862d"),
    limits = c(500,2250),
    name = "Rent")+
  theme_void()+
  theme(legend.title = element_text(size = 10),
        legend.text = element_text(size = 8))+
    theme(legend.position = "left")+
  theme(plot.title = element_text(hjust = 1))

Map_ALL+Map_GDA+ plot_layout(widths = c(2,1.5))

Energy

Back in May the CSO began to publish data on Data Centers Electricity consumption. See the IT article “Metered electricity consumption by data centers increased from 290 gigawatt hours in the period from January to March 2015 to 1,058 in October to December 2021.

A gigawatt of power is enough electricity to supply more than 500,000 homes.” - I’m not sure about the maths on the 500,000 homes. The US Department of Energy lay out the maths on a gigawatt equating to 9,090 Nissan Leafs or 100 Million LED bulbs.

How 1 Leaf could be worth 55 homes is beyond me… Regardless the trends below are often measures in gigawatt (GWH).

I suspect the CSO will update this again soon as the latest quarter to date has been from Q4 2021. I’ve included that data in this section, also I’ve included Gas consumption. - For obvious reasons.

Electricity Consumption

“Data centres use up a considerably higher share of electricity in the State than in other countries. A 2020 European Commission put average data centre usage in 2018 at 2.7 per cent of electricity demand, compared with 14 per cent in Ireland.” - From the previously linked article.

MEC02 <- cso_get_data("MEC02")
MEC02 <- MEC02 %>%
  pivot_longer(!1:2,names_to="year_qtr")
MEC02 <- MEC02 %>%
  filter(Electricity.Consumption!="All metered electricity consumption")
MEC02$Year_Q <- as.yearqtr(MEC02$year_qtr)
MEC02$Year <- year(MEC02$Year_Q)

MEC02.Res <- MEC02 %>%
  filter(Electricity.Consumption=="Data centres")
MEC02.Non <- MEC02 %>%
  filter(Electricity.Consumption=="Customers other than data centres")

ggplot(data=MEC02.Res,aes(x=Year_Q,y=value,group=1))+
  geom_line(colour="navy",size=2,alpha=0.7)+
  geom_line(data=MEC02.Non,aes(x=Year_Q,y=value,group=1),colour="#E1B020",size=2,alpha=0.7)+
  geom_text_repel(aes(x=Year_Q,y=value,label=value),data = MEC02.Res,size=3,max.overlaps = 2)+
  geom_text_repel(aes(x=Year_Q,y=value,label=value),data = MEC02.Non,size=3,max.overlaps = 3)+
  theme_bw()+
  ylab("Gigawatt Hours (GWH)")+
  labs(subtitle="Data Centres vs All Other Customers",caption = "navy line = data centres, orange line = all other")+
  ggtitle("Metered Electricity Consumption")

Gas Consumption

Residential gas consumption at peak season tends to be approximately 35% of Non-residential, which is less seasonal in trend.

MGC01 <- cso_get_data("MGC01")
MGC01 <- MGC01 %>%
  pivot_longer(!1:3,names_to="year_qtr")
MGC01$Year_Q <- as.yearqtr(MGC01$year_qtr)
MGC01$Year <- year(MGC01$Year_Q)
MGC01_State <- MGC01 %>%
  filter(Counties...Dublin.Postal.Districts=="All Counties and Dublin Postal Districts")

MGC01_State.Res <- MGC01_State %>%
  filter(Sector=="Residential")
MGC01_State.Non <- MGC01_State %>%
  filter(Sector=="Non-residential including power plants")

ggplot(data=MGC01_State.Res,aes(x=Year_Q,y=value,group=1))+
  geom_line(colour="#D50AD5",size=1.5,alpha=0.7)+
  geom_line(data=MGC01_State.Non,aes(x=Year_Q,y=value,group=1),colour="#0AD5C5",size=1.5,alpha=0.7)+
  geom_text_repel(aes(x=Year_Q,y=value,label=value),data = MGC01_State.Res,size=3,max.overlaps = 2)+
  geom_text_repel(aes(x=Year_Q,y=value,label=value),data = MGC01_State.Non,size=3,max.overlaps = 3)+
  theme_bw()+
  ylab("Gigawatt Hours (GWH)")+
  labs(subtitle="Residential vs Non-Residential",caption = "pink line = residential consumption, blue line = non-residential consumption")+
  ggtitle("Metered Gas Consumption")

Average Earnings

The public sector pay deal has been in the headlines of late. This section takes the latest data from the CSO for public sector workers and a high level of private sector workers.

# Public or Private Sector level
EHQ08 <- cso_get_data("EHQ08")
EHQ08 <- EHQ08 %>%
  filter(Statistic=="Average Weekly Earnings") %>%
  filter(Private.or.Public.Sector != "All sectors")
EHQ08 <- EHQ08 %>%
  pivot_longer(!1:2,names_to = "year_qtr")

EHQ08$Year_Q <- as.yearqtr(EHQ08$year_qtr)
EHQ08$Year <- year(EHQ08$Year_Q)

ggplot(EHQ08,aes(x=Year_Q,y=value,group=Private.or.Public.Sector,colour=Private.or.Public.Sector))+
  geom_line(size=1.5,alpha=0.5)+
  geom_text_repel(aes(x=Year_Q,y=value,label=value),data = EHQ08,size=3,max.overlaps = 5,colour="black")+
  theme_bw()+
  ggtitle("Average Weekly Earnings - EHQ08")+
  theme(legend.position = "bottom")+
  scale_colour_manual(values=c("#999999", "#E69F00"),
                      name="Sector")+
  ylab("euro")

Public Sector

# Public Sectors
EHQ10 <- cso_get_data("EHQ10")
EHQ10 <- EHQ10 %>%
  filter(Statistic=="Average Weekly Earnings") %>%
  filter(Sub.Sector != "Total Public Sector including Semi State bodies")%>%
  filter(Sub.Sector != "Total Public Sector excluding Semi State bodies")
EHQ10 <- EHQ10 %>%
  pivot_longer(!1:2,names_to = "year_qtr")

EHQ10$Year_Q <- as.yearqtr(EHQ10$year_qtr)
EHQ10$Year <- year(EHQ10$Year_Q)

EHQ10$SMAvalue <- SMA(EHQ10$value,n=4) ###### need to SMA by group!!!!!!!!
# try below to remove first 3 quarters

EHQ10$SMAvalue[EHQ10$year_qtr=="2008Q1" | EHQ10$year_qtr=="2008Q2" | EHQ10$year_qtr=="2008Q3"] <- NA

EHQ08.Pub <- EHQ08 %>%
  filter(Private.or.Public.Sector == "Public sector")

Fig.Public.Sec.Pay<- ggplot(EHQ10,aes(x=Year_Q,y=value,group=Sub.Sector,colour=Sub.Sector))+
  geom_line(data=EHQ08.Pub,aes(x=Year_Q,y=value,group=1),colour="#9D9E9E",linetype="dashed",alpha=0.75)+
  geom_line(data=EHQ10,aes(x=Year_Q,y=SMAvalue,group=1),colour="#9D9E9E",linetype="solid",alpha=0.75)+
  geom_line(alpha=0.5,size=1)+
  geom_text_repel(aes(x=Year_Q,y=value,label=value),data = EHQ10,size=2.5,max.overlaps = 6,colour="black")+
  theme_bw()+
  ggtitle("Public Sector: Average Weekly Earnings - EHQ10")+
  theme(legend.position = "none")+
  ylab("euro")

Fig.Public.Sec.Pay + facet_wrap(~Sub.Sector) +
  labs(caption="dotted line = average weekly earnings for public sector (EHQ08), solid line = simple moving average, t = 4")

Private Sector

The EHQ13 data set aggregates NACE sectors into 4 broad groups, one includes public servants so it will be excluded. The remainder, one of which is an aggregation, will be viewed separately with the three “Types” of employees faceted for each.

Industry

Sectors: B to E

# All
EHQ13 <- cso_get_data("EHQ13")
EHQ13 <- EHQ13 %>%
  pivot_longer(!1:3,names_to = "year_qtr")
EHQ13$Year_Q <- as.yearqtr(EHQ13$year_qtr)
EHQ13$Year <- year(EHQ13$Year_Q)

# Industry
EHQ13.1 <- EHQ13 %>%
  filter(Economic.Sector.NACE.Rev.2 == "Industry (B to E)")


EHQ13.1$SMAvalue <- SMA(EHQ13.1$value,n=4) 
EHQ13.1$SMAvalue[EHQ13.1$year_qtr=="2010Q1" | EHQ13.1$year_qtr=="2010Q2" | EHQ13.1$year_qtr=="2010Q3"| EHQ13.1$year_qtr=="2010Q4"] <- NA

EHQ08.Pri <- EHQ08 %>%
  filter(Private.or.Public.Sector == "Private sector")

Fig.Private.Sec.Pay.1<- ggplot(EHQ13.1,aes(x=Year_Q,y=value,group=Type.of.Employee,colour=Type.of.Employee))+
  geom_line(data=EHQ08.Pri,aes(x=Year_Q,y=value,group=1),colour="#9D9E9E",linetype="dashed",alpha=0.75)+
  geom_line(data=EHQ13.1,aes(x=Year_Q,y=SMAvalue,group=1),colour="#9D9E9E",linetype="solid",alpha=0.75)+
  geom_line(alpha=0.5,size=1)+
  geom_text_repel(aes(x=Year_Q,y=value,label=value),data = EHQ13.1,size=2.5,max.overlaps = 12,colour="black")+
  theme_bw()+
  ggtitle("Private Sector - Industry: Average Earnings - EHQ13")+
  theme(legend.position = "bottom")+
  ylab("euro")+guides(color=guide_legend(nrow=4, byrow=TRUE))

Fig.Private.Sec.Pay.1 + facet_wrap(~Type.of.Employee) + 
  theme(
  strip.background = element_blank(),
  strip.text.x = element_blank())+
  labs(caption="dotted line = average weekly earnings for private sector (EHQ08), solid line = simple moving average, t = 4")

Business and services

Sectors: B to N,R,S

EHQ13.2 <- EHQ13 %>%
   filter(Economic.Sector.NACE.Rev.2 == "Business and services (B to N,R,S)")
 
 EHQ13.2$SMAvalue <- SMA(EHQ13.2$value,n=4) 
 EHQ13.2$SMAvalue[EHQ13.2$year_qtr=="2010Q1" | EHQ13.2$year_qtr=="2010Q2" | EHQ13.2$year_qtr=="2010Q3"| EHQ13.2$year_qtr=="2010Q4"] <- NA
 

 Fig.Private.Sec.Pay.1<- ggplot(EHQ13.2,aes(x=Year_Q,y=value,group=Type.of.Employee,colour=Type.of.Employee))+
   geom_line(data=EHQ08.Pri,aes(x=Year_Q,y=value,group=1),colour="#9D9E9E",linetype="dashed",alpha=0.75)+
   geom_line(data=EHQ13.2,aes(x=Year_Q,y=SMAvalue,group=1),colour="#9D9E9E",linetype="solid",alpha=0.75)+
   geom_line(alpha=0.5,size=1)+
   geom_text_repel(aes(x=Year_Q,y=value,label=value),data = EHQ13.2,size=2.5,max.overlaps = 12,colour="black")+
   theme_bw()+
   ggtitle("Private Sector - Business & Services: Average Earnings - EHQ13")+
   theme(legend.position = "bottom")+
   ylab("euro")+guides(color=guide_legend(nrow=4, byrow=TRUE))
 
 Fig.Private.Sec.Pay.1 + facet_wrap(~Type.of.Employee) + 
   theme(
   strip.background = element_blank(),
   strip.text.x = element_blank())+
   labs(caption="dotted line = average weekly earnings for private sector (EHQ08), solid line = simple moving average, t = 4")

All excluding activities

Sectors: A,T and U (B to S)

# All
EHQ13.3 <- EHQ13 %>%
  filter(Economic.Sector.NACE.Rev.2 == "All NACE economic sectors excluding activities A,T and U (B to S)")


EHQ13.3$SMAvalue <- SMA(EHQ13.3$value,n=4) 
EHQ13.3$SMAvalue[EHQ13.3$year_qtr=="2010Q1" | EHQ13.3$year_qtr=="2010Q2" | EHQ13.3$year_qtr=="2010Q3"| EHQ13.3$year_qtr=="2010Q4"] <- NA

Fig.Private.Sec.Pay.1<- ggplot(EHQ13.3,aes(x=Year_Q,y=value,group=Type.of.Employee,colour=Type.of.Employee))+
  geom_line(data=EHQ08.Pri,aes(x=Year_Q,y=value,group=1),colour="#9D9E9E",linetype="dashed",alpha=0.75)+
  geom_line(data=EHQ13.3,aes(x=Year_Q,y=SMAvalue,group=1),colour="#9D9E9E",linetype="solid",alpha=0.75)+
  geom_line(alpha=0.5,size=1)+
  geom_text_repel(aes(x=Year_Q,y=value,label=value),data = EHQ13.3,size=2.5,max.overlaps = 12,colour="black")+
  theme_bw()+
  ggtitle("Private Sector - All Sectors: Average Earnings - EHQ13")+
  theme(legend.position = "bottom")+
  ylab("euro")+guides(color=guide_legend(nrow=4, byrow=TRUE))

Fig.Private.Sec.Pay.1 + facet_wrap(~Type.of.Employee) + 
  theme(
  strip.background = element_blank(),
  strip.text.x = element_blank())+
  labs(caption="dotted line = average weekly earnings for private sector (EHQ08), solid line = simple moving average, t = 4")

Unemployment

MUM01 <- cso_get_data("MUM01")
MUM01 <- MUM01 %>%
  pivot_longer(!1:3, names_to = "yearm")

MUM01 <- MUM01 %>%
  filter(Statistic == "Seasonally Adjusted Monthly Unemployment Rate")%>%
  filter(Sex == "Both sexes") %>%
  filter(Age.Group == "15 - 74 years" | Age.Group == "25 - 74 years")
MUM01<- MUM01 %>%
  separate(yearm, c("Year", "Month"), sep=" ")
MUM01$Year <- as.integer(MUM01$Year)
MUM01$Date <- as.Date(paste(paste(MUM01$Month, sep = " ", "1"),sep = " ",MUM01$Year),"%B %d %Y")
 
MUM01_16 <- MUM01 %>%
  filter(Year >= "2016")
MUM01_21 <- MUM01 %>%
  filter(Year >= "2021")
MUM01_YTD <- MUM01 %>%
  filter(Year >= "2022")
                     
Fig.Unemp.1 <- ggplot(data=MUM01, aes(x=Date, y=value, group = Age.Group, colour=Age.Group))+
  geom_line(linejoin="mitre", linetype = 1,alpha = 0.5)+
  scale_colour_manual(values=c("navy","red"))+
  theme_bw()+
  labs(subtitle = "January 1998 to date",
       y=NULL,
       x=NULL)+  theme(legend.position = "none")

Fig.Unemp.2 <- ggplot(data=MUM01_16, aes(x=Date, y=value, group = Age.Group, colour=Age.Group))+
  geom_line(linejoin="mitre",size = 1.25, linetype = 1,alpha = 0.5)+
  scale_colour_manual(values=c("navy","red"))+
  geom_text_repel(aes(label=value),data = MUM01_16, size = 3,colour="black",max.overlaps = 5)+
  theme_bw()+
  labs(title = "Unemployment" ,
       subtitle = "2016 to date",
       y="Unemployment Rate",
       x="Month")+
  theme(legend.position = "bottom")

Fig.Unemp.3 <- ggplot(data=MUM01_21, aes(x=Date, y=value, group = Age.Group, colour=Age.Group))+
  geom_line(linejoin="mitre", linetype = 1,alpha = 0.5)+
  scale_colour_manual(values=c("navy","red"))+
  theme_bw()+
  labs(subtitle = "January 2021 to date",
       y=NULL,
       x=NULL)+  theme(legend.position = "none")

Fig.Unemp.4 <- ggplot(data=MUM01_YTD, aes(x=Date, y=value, group = Age.Group, colour=Age.Group))+
  geom_line(linejoin="mitre", linetype = 1,alpha = 0.5)+
  scale_colour_manual(values=c("navy","red"))+
  theme_bw()+
  labs(subtitle = "Year to date",
       y=NULL,
       x=NULL)+  theme(legend.position = "none")

Fig.Unemp.RightFacet<- Fig.Unemp.1 + Fig.Unemp.3 + Fig.Unemp.4 + plot_layout(nrow=3)

Fig.Unemp.2+ Fig.Unemp.RightFacet+ plot_layout(ncol=2,widths = c(2,1))

Retail Sales

RSM05 <- cso_get_data("RSM05")
RSM05 <- RSM05 %>%
  pivot_longer(!1:2, names_to = "year_month")

# Date transformation
## Take adjusted index only

RSM05 <- RSM05%>%filter(Statistic=="Retail Sales Index Value Adjusted"|Statistic=="Retail Sales Index Volume Adjusted")

RSM05$Month <- as.Date(paste(RSM05$year_month, "01", sep = "-"), "%YM%m-%d")
RSM05$Year <- year(RSM05$Month)
RSM05$Lag <- Lag(RSM05$value,1)
RSM05$Diff <- RSM05$value-RSM05$Lag

RSM05_A <- RSM05%>%
  filter(NACE.Group=="All retail businesses")

RSM05_B <- RSM05%>%
  filter(NACE.Group=="Motor trades (45)"|NACE.Group=="Retail sale in non-specialised stores with food, beverages or tobacco predominating (4711)"|NACE.Group=="Department stores (4719)"|NACE.Group=="Retail sale of automotive fuel (4730)"|NACE.Group=="Retail sale of hardware, paints and glass (4752)"|NACE.Group=="Retail sale of furniture and lighting (4759)"|NACE.Group=="Bars (5630)")

# RSI
## Full Sample
RSM05_A1 <- RSM05_A%>%filter(Statistic=="Retail Sales Index Value Adjusted")
RSM05_A2 <- RSM05_A%>%filter(Statistic=="Retail Sales Index Volume Adjusted")

Fig.RSM.1<-ggplot(data=RSM05_A1,aes(x=Month,y=value))+
  geom_line(size = 1.15, linetype=1, alpha = 0.6, colour = "#4aa98a")+
  geom_hline(aes(yintercept=100), 
             colour= "#404040",
             linetype = 1)+
  theme_bw()+
  geom_text_repel(aes(label=value),data = RSM05_A1, size = 3,colour="black",max.overlaps = 7)+
  labs(title = "RSI Value (Adjusted) - RSM05", subtitle = "2015 to Date")+
  xlab("Year-Month")+
  ylab("RSI (Base Dec 2015=100)")+
  theme(panel.border = element_rect(linetype = 1, fill = NA))

Fig.RSM.2<-ggplot(data=RSM05_A2,aes(x=Month,y=value))+
  geom_line(size = 1.15, linetype=1, alpha = 0.6, colour = "#a55a94")+
  geom_hline(aes(yintercept=100), 
             colour= "#404040",
             linetype = 1)+
  theme_bw()+
  geom_text_repel(aes(label=value),data = RSM05_A2, size = 3,colour="black",max.overlaps = 7)+
  labs(title = "RSI Volume (Adjusted) - RSM05", subtitle = "2015 to Date")+
  xlab("Year-Month")+
  ylab(NULL)+
  theme(panel.border = element_rect(linetype = 1, fill = NA))

#Fig.RSM.1 + Fig.RSM.2 + plot_layout(ncol=2)

## YTD
Fig.RSM.3<-ggplot(data=subset(RSM05_A1,Year >= "2022"),aes(x=Month,y=value))+
  geom_line(size = 1.15, linetype=1, alpha = 0.6, colour = "#4aa98a")+
  geom_text_repel(aes(label=value),data=subset(RSM05_A1,Year >= "2022"), size = 3,colour="black",max.overlaps = 7)+
  theme_bw()+
  labs(subtitle = "YTD")+
  xlab(NULL)+
  ylab(NULL)+
  theme(panel.border = element_rect(linetype = 1, fill = NA))

Fig.RSM.4<-ggplot(data=subset(RSM05_A2,Year >= "2022"),aes(x=Month,y=value))+
  geom_line(size = 1.15, linetype=1, alpha = 0.6, colour = "#a55a94")+
  theme_bw()+
  geom_text_repel(aes(label=value),data=subset(RSM05_A2,Year >= "2022"), size = 3,colour="black",max.overlaps = 7)+
  labs(subtitle = "YTD")+
  xlab(NULL)+
  ylab(NULL)+
  theme(panel.border = element_rect(linetype = 1, fill = NA))


Fig.RSM.1 + Fig.RSM.2 + Fig.RSM.3 + Fig.RSM.4 + plot_layout(nrow = 2,heights = c(2,1.5))

RSM05_B1 <- RSM05_B%>%filter(Statistic=="Retail Sales Index Value Adjusted")
RSM05_B2 <- RSM05_B%>%filter(Statistic=="Retail Sales Index Volume Adjusted")

FigNACE<-ggplot(data=subset(RSM05_B1,Year >= "2022"), aes(x=Month, y=value, group=NACE.Group, colour=NACE.Group))+
  geom_line(aes(group=NACE.Group),size = 1.05, linetype=1, alpha = 0.65)+
  labs(title = "RSI Value by NACE Group")+
  xlab("Year-Month")+
  ylab("2015 = 100")+
  geom_hline(aes(yintercept=100), 
             colour= "#404040",
             linetype = 1)+
  theme_bw()+
  geom_text_repel(aes(label=value),data=subset(RSM05_B1,Year >= "2022"),size=3,colour="black",max.overlaps = 10)+
    scale_x_date(date_labels="%b-%Y",date_breaks  ="1 month")+
  theme(axis.text.x = element_text(angle=90))+
  theme(axis.text.x=element_text(size=10))+
  theme(legend.position="none")+
  theme(axis.text = element_text(size = rel(1)))+
  theme(plot.title=(element_text(vjust =2)))+
  theme(panel.border = element_rect(linetype = 1, fill = NA))

Fig.RSM.5<-FigNACE + facet_wrap(~NACE.Group, ncol = 1)

FigNACE2<-ggplot(data=subset(RSM05_B2,Year >= "2022"), aes(x=Month, y=value, group=NACE.Group, colour=NACE.Group))+
  geom_line(aes(group=NACE.Group),size = 1.05, linetype=1, alpha = 0.65)+
  labs(title = "RSI Volume by NACE Group")+
  xlab("Year-Month")+
  ylab("2015 = 100")+
  geom_hline(aes(yintercept=100), 
             colour= "#404040",
             linetype = 1)+
  theme_bw()+
  geom_text_repel(aes(label=value),data=subset(RSM05_B2,Year >= "2022"),size=3,colour="black",max.overlaps = 10)+
    scale_x_date(date_labels="%b-%Y",date_breaks  ="1 month")+
  theme(axis.text.x = element_text(angle=90))+
  theme(axis.text.x=element_text(size=10))+
  theme(legend.position="none")+
  theme(axis.text = element_text(size = rel(1)))+
  theme(plot.title=(element_text(vjust =2)))+
  theme(panel.border = element_rect(linetype = 1, fill = NA))

Fig.RSM.6<-FigNACE2 + facet_wrap(~NACE.Group, ncol = 1)

Fig.RSM.5+Fig.RSM.6