Land Utilisation

My reading of this is that the average size of farms have increased with the smaller farms being consolidated or sold off.

# Census Data for Land Utilisation
AVA32 <- cso_get_data("AVA32")
AVA32 <-  AVA32 %>%
  pivot_longer(!1:3, names_to = "year")

AVA32$value <- as.integer(AVA32$value)

AVA32.N <- AVA32 %>%
  filter(Statistic=="Farms with Crops") %>%
  filter(Type.of.Crop != "Area farmed (AAU)") %>%
  filter(Type.of.Crop != "All grassland") %>%
  filter(Type.of.Crop != "Commonage")

AVA32.A <- AVA32 %>%
  filter(Statistic=="Average Area Farmed")%>%
  filter(Type.of.Crop=="Area farmed (AAU)")

AVA32.N2 <- AVA32 %>%
  filter(Statistic=="Farms with Crops")%>%
  filter(Type.of.Crop=="All grassland")

AVA32.N_T <- AVA32.N %>%
  group_by(Statistic,Type.of.Crop,year)%>%
  summarise(value=sum(value,na.rm=TRUE))

AVA32.N_T %>%
  ggplot(aes(x=year,y=value,group=Type.of.Crop,colour=Type.of.Crop,fill=Type.of.Crop))+
  geom_col(alpha=0.4)+
  geom_text(position=position_stack(vjust=0.5),aes(label=value))+
  theme_bw()+
  theme(legend.position = "bottom")+
  xlab("Census Year")+ylab("Number of farms")+
  ggtitle("Land Utilisation - Total")+
  labs(subtitle="AVA32",caption="removed categories: 'All grassland', 'Area farmed' assuming double count. removed 'Commonage due to the value being zero " )

# Map
shp <- sf::read_sf("/Users/harte/OneDrive/Experimental/Counties___OSi_National_Statutory_Boundaries_.shp")
GEO_Merge.Counties <- readxl::read_xlsx(path="C:\\Users\\harte\\OneDrive\\Experimental\\Counties.Agri.xlsx")

AVA32.A<- AVA32.A %>%
  rename(County.CSO=County)
AVA32.A <- right_join(GEO_Merge.Counties,AVA32.A,by="County.CSO")

AVA32.N2<- AVA32.N2 %>%
  rename(County.CSO=County)
AVA32.N2 <- right_join(GEO_Merge.Counties,AVA32.N2,by="County.CSO")

shp_AVA32.A <- merge(shp,AVA32.A,by.x="COUNTY",by.y="County")
shp_AVA32.N2 <- merge(shp,AVA32.N2,by.x="COUNTY",by.y="County")

shp_AVA32.N2 %>%
  ggplot() +
  geom_sf(aes(fill = value,alpha=0.9))+
  theme_void()+
  scale_fill_distiller(palette = "Spectral", name="NR")+
  ggtitle("Land Utilisation")+theme(plot.title = element_text(face = "bold"))+
  labs(subtitle="Farms with Crops: All grassland",
       caption = "CSO: AVA32")+
  facet_wrap(~year,ncol=3)  

shp_AVA32.A %>%
  ggplot() +
  geom_sf(aes(fill = value,alpha=0.9))+
  theme_void()+
  scale_fill_distiller(palette = "Spectral", name="HA")+
  ggtitle("Land Utilisation")+theme(plot.title = element_text(face = "bold"))+
  labs(subtitle="Area farmed: Average Area Farmed (Hectares)",
       caption = "CSO: AVA32")+
    facet_wrap(~year,ncol=3)  

# Cross reference with AVA24: Land Holdings
AVA24 <- cso_get_data("AVA24")
AVA24 <-  AVA24 %>%
  pivot_longer(!1:3, names_to = "year")

AVA24_T <- AVA24 %>%
  group_by(Statistic,Size.of.Holding,year)%>%
  summarise(value=sum(value,na.rm=TRUE))
AVA24_T <- AVA24_T %>%
  filter(Size.of.Holding!="All farms")
AVA24_T %>%
  ggplot(aes(x=year,y=value,group=Size.of.Holding,colour=Size.of.Holding,fill=Size.of.Holding))+
           geom_col(alpha=0.4)+
           geom_text(position=position_stack(vjust=0.5),aes(label=value))+
           theme_bw()+
           theme(legend.position = "bottom")+
           xlab("Census Year")+ylab("Holdings (Number)")+
           ggtitle("Agricultural Holdings - Total")+
           labs(subtitle="AVA24",caption="" )

AVA24.100 <- AVA24 %>%
  filter(Size.of.Holding=="100 ha or more")
AVA24.50 <- AVA24 %>%
  filter(Size.of.Holding=="50 ha or more but less than 100 ha")

#AVA24$value <- as.integer(AVA24$value)

Cork, Tipperary and Meath stand out.

AVA24.100<- AVA24.100 %>%
  rename(County.CSO=County)
AVA24.100 <- right_join(GEO_Merge.Counties,AVA24.100,by="County.CSO")

AVA24.50<- AVA24.50 %>%
  rename(County.CSO=County)
AVA24.50 <- right_join(GEO_Merge.Counties,AVA24.50,by="County.CSO")

shp_AVA24.100 <- merge(shp,AVA24.100,by.x="COUNTY",by.y="County")
shp_AVA24.50 <- merge(shp,AVA24.50,by.x="COUNTY",by.y="County")

shp_AVA24.100 %>%
  ggplot() +
  geom_sf(aes(fill = value,alpha=0.9))+
  theme_void()+
  scale_fill_fermenter(n.breaks = 9, palette = "PuOr",name="NR")+
  ggtitle("Agricultural Holdings")+theme(plot.title = element_text(face = "bold"))+
  labs(subtitle="Holdings with 100 ha or more",
       caption = "CSO: AVA24")+
  facet_wrap(~year,ncol=2)  

shp_AVA24.50 %>%
  ggplot() +
  geom_sf(aes(fill = value,alpha=0.9))+
  theme_void()+
  scale_fill_fermenter(n.breaks = 9, palette = "PuOr",name="NR")+
  ggtitle("Agricultural Holdings")+theme(plot.title = element_text(face = "bold"))+
  labs(subtitle="Holdings with 50 to 100 ha",
       caption = "CSO: AVA24")+
  facet_wrap(~year,ncol=2)  

Milk

AKM01<-cso_get_data("AKM01")
AKM02<-cso_get_data("AKM02")
AKM03<-cso_get_data("AKM03")

AKM01 <- AKM01%>%
  pivot_longer(!1:2,names_to = "year_month")
AKM02 <- AKM02%>%
  pivot_longer(!1:2,names_to = "year_month")
AKM03 <- AKM03%>%
  pivot_longer(!1:2,names_to = "year_month")

AKM01$Year <-substr(AKM01$year_month,1,4)
AKM01$Month <- sub(".* ", "", AKM01$year_month)
AKM01$Month_NR <- as.integer(factor(AKM01$Month, levels=month.name))
AKM01$Date <- as.yearmon(paste(AKM01$Year, AKM01$Month_NR), "%Y %m")
AKM02$Year <-substr(AKM02$year_month,1,4)
AKM02$Month <- sub(".* ", "", AKM02$year_month)
AKM02$Month_NR <- as.integer(factor(AKM02$Month, levels=month.name))
AKM02$Date <- as.yearmon(paste(AKM02$Year, AKM02$Month_NR), "%Y %m")
AKM03$Year <-substr(AKM03$year_month,1,4)
AKM03$Month <- sub(".* ", "", AKM03$year_month)
AKM03$Month_NR <- as.integer(factor(AKM03$Month, levels=month.name))
AKM03$Date <- as.yearmon(paste(AKM03$Year, AKM03$Month_NR), "%Y %m")

AKM01$value<-as.numeric(AKM01$value)
AKM02$value<-as.numeric(AKM02$value)
AKM03$value<-as.numeric(AKM03$value)

Intake of Cows Milk

Domestic

# AKM01
## Statistics included: 1.Intake (ltr), 2.Fat (%), 3.Protein (%)
AKM01.1 <- AKM01 %>%
  filter(Statistic=="Intake of Cows Milk by Creameries and Pasteurisers")


AKM01.1.1 <- AKM01.1 %>%
  filter(Domestic.or.Import.Source=="Domestic")
# T_AKM01.1.1_1 <- AKM01.1.1 %>%
#   group_by(Year)%>%
#   summarise(Average_Intake = mean(value),
#             Total_Intake = sum(value))
# 
# ggplot(data=T_AKM01.1.1_1, aes(x=Year,y=Average_Intake,group=1))+
#   geom_line(colour="#00B700")+
#   theme_bw()+
#   geom_text_repel(aes(label=round(Average_Intake, digits=2)),data = T_AKM01.1.1_1, size = 2.5)+
#   ggtitle("Average - Intake of Cows Milk by Creameries and Pasteurisers")+
#   labs(subtitle = "AKM01-Domestic",y="Million Litres")+
#   theme(plot.title=element_text(face="bold"))

AKM01.1.1$SMA.12 <- round(SMA(AKM01.1.1$value,n=12),digits=2)
AKM01.1.1_Max <- AKM01.1.1 %>%
  slice(which.max(Date))
AKM01.1.1 %>%
  ggplot(aes(x=Date,y=SMA.12,group=1))+
  geom_line(colour="#00B700")+
  theme_bw()+
  geom_text_repel(aes(label=round(value, digits=2)),size = 2.5,colour="black",alpha=0.6)+
  geom_text(data=AKM01.1.1_Max,aes(label=round(value,digits=2)),colour="black")+
  ggtitle("Intake of Cows Milk by Creameries and Pasteurisers")+
  labs(subtitle = "AKM01-Domestic: 12 Month Moving Average",y="Million Litres")+
  theme(plot.title=element_text(face="bold"))

Import

# AKM01
## Statistics included: 1.Intake (ltr), 2.Fat (%), 3.Protein (%)
# AKM01.1 <- AKM01 %>%
#   filter(Statistic=="Intake of Cows Milk by Creameries and Pasteurisers")
# AKM01.1.2 <- AKM01.1 %>%
#   filter(Domestic.or.Import.Source=="Import")
# T_AKM01.1.2_1 <- AKM01.1.2 %>%
#   group_by(Year)%>%
#   summarise(Average_Intake = mean(value),
#             Total_Intake = sum(value))
# ggplot(data=T_AKM01.1.2_1, aes(x=Year,y=Average_Intake,group=1))+
#   geom_line(colour="#0B00B7")+
#   theme_bw()+
#   geom_text_repel(aes(label=round(Average_Intake, digits=2)),data = T_AKM01.1.2_1, size = 2.5)+
#   ggtitle("Average - Intake of Cows Milk by Creameries and Pasteurisers")+
#   labs(subtitle = "AKM01-Import",y="Million Litres")+
#   theme(plot.title=element_text(face="bold"))
# 
# ggplot(data=T_AKM01.1.2_1, aes(x=Year,y=Total_Intake,group=1))+
#   geom_col(fill="#0B00B7",alpha=0.5)+
#   theme_bw()+
#   geom_text_repel(aes(label=round(Total_Intake, digits=2)),data = T_AKM01.1.2_1, size = 2.5)+
#   ggtitle("Total - Intake of Cows Milk by Creameries and Pasteurisers")+
#   labs(subtitle = "AKM01-Import",y="Million Litres")+
#   theme(plot.title=element_text(face="bold"))

Dairy Sales for Human Consumption

AKM02.1 <- AKM02 %>%
  filter(Type.of.Milk != "All Milk")

AKM02.1 %>%
  ggplot(aes(x=Date,y=value,group=Type.of.Milk,colour=Type.of.Milk))+
  geom_line()+
  geom_text_repel(aes(label=value),alpha=0.7,max.overlaps = 8)+
  theme_bw()+
  theme(legend.position = "none")+
  ggtitle("Milk Sales for Human Consumption")+
  ylab("Million Litres")+
  facet_wrap(~Type.of.Milk,ncol=2,labeller = labeller(Type.of.Milk = label_wrap_gen(width = 45)))

Production of Dairy Products

AKM03 %>%
  ggplot(aes(x=Date,y=value,group=Product,colour=Product))+
  geom_line()+
  geom_text_repel(aes(label=value),alpha=0.7,max.overlaps = 8)+
  theme_bw()+
  theme(legend.position = "none")+
  ggtitle("Production of Dairy Products")+
  ylab("Tonnes")+
  facet_wrap(~Product,ncol=1)

Removing Skimmed Milk Powder as it is a broken series and run a 12 month moving average

AKM03.1 <- AKM03 %>%
  filter(Product != "Skimmed Milk Powder")
AKM03.1 <- na.omit(AKM03.1)
AKM03.1$SMA.12 <- round(SMA(AKM03.1$value,n=12),digits=2)
AKM03.1$SMA.12[AKM03.1$Date=="Jan 1980" | AKM03.1$Date=="Feb 1980" | AKM03.1$Date=="Mar 1980"|AKM03.1$Date=="Apr 1980" | AKM03.1$Date=="May 1980"| AKM03.1$Date=="Jun 1980" | AKM03.1$Date=="Jul 1980"|AKM03.1$Date=="Aug 1980" | AKM03.1$Date=="Sep 1980"| AKM03.1$Date=="Oct 1980"|AKM03.1$Date=="Nov 1980" | AKM03.1$Date=="Dec 1980"] <- NA

AKM03.1_Max <- AKM03.1 %>%
  group_by(Product)%>%
  slice(which.max(Date))

AKM03.1 %>%
  ggplot(aes(x=Date,y=SMA.12,group=Product,colour=Product))+
  geom_line(size=1.25,alpha=0.8)+
  geom_line(data=AKM03.1,aes(x=Date,y=value,group=Product,colour=Product),alpha=0.2)+
  geom_text_repel(aes(label=value),alpha=0.7,max.overlaps = 8)+
  geom_text(data=AKM03.1_Max,aes(label=SMA.12),colour="black",alpha=0.7)+
  theme_bw()+
  theme(legend.position = "none")+
  ggtitle("Production of Dairy Products")+
  labs(subtitle="12 month moving average")+
  ylab("Tonnes")+
  facet_wrap(~Product,ncol=1)

Livestock

ADM01 <- cso_get_data("ADM01")
ADM01 <- ADM01 %>%
  pivot_longer(!1:2, names_to = "yearm")
ADM01$Month <- as.Date(paste(ADM01$yearm, "01", sep = "-"), "%YM%m-%d")
ADM01$Year <- year(ADM01$Month)

ADM01 <- na.omit(ADM01)

ADM01.N <- ADM01 %>%
  filter(Statistic == "Number of Livestock Slaughtered")
ADM01.N$SMA.12 <- round(SMA(ADM01.N$value,n=12),digits=2)

ADM01.N <- ADM01.N %>%
  filter(Month >= "1980-12-01")
ADM01.N_Max <- ADM01.N %>%
  group_by(Type.of.Animal)%>%
  slice(which.max(Month))

ADM01.N %>%
  ggplot(aes(x=Month,y=value,group=Type.of.Animal,colour=Type.of.Animal))+
  geom_line(alpha=0.4)+
  geom_line(aes(x=Month,y=SMA.12,group=Type.of.Animal,colour=Type.of.Animal))+
  geom_text(data=ADM01.N_Max,aes(label=SMA.12),colour="black",size=2.5,alpha=0.7)+
  theme_bw()+
  ylab("thousands")+
  ggtitle("Livestock Slaughterings")+
  labs(subtitle="Number Slaughtered")+
  theme(legend.position="none")+
  facet_wrap(~Type.of.Animal,ncol=2)

ADM01.W <- ADM01 %>%
  filter(Statistic != "Number of Livestock Slaughtered")
ADM01.W$SMA.12 <- round(SMA(ADM01.W$value,n=12),digits=2)

ADM01.W <- ADM01.W %>%
  filter(Month >= "1980-12-01")
ADM01.W_Max <- ADM01.W %>%
  group_by(Type.of.Animal)%>%
  slice(which.max(Month))

ADM01.W %>%
  ggplot(aes(x=Month,y=value,group=Type.of.Animal,colour=Type.of.Animal))+
  geom_line(alpha=0.4)+
  geom_line(aes(x=Month,y=SMA.12,group=Type.of.Animal,colour=Type.of.Animal))+
  geom_text(data=ADM01.W_Max,aes(label=SMA.12),colour="black",size=2.5,alpha=0.7)+
  theme_bw()+
  ylab("thousands (tonnes)")+
  ggtitle("Livestock Slaughterings")+
  labs(subtitle="Weight Slaughtered")+
  theme(legend.position="none")+
  facet_wrap(~Type.of.Animal,ncol=2)

Input & Output Prices

Inputs

Outputs

Value Chain