INTRODUCTION
  This is a project on Financial Anayticts using 'R' language, covering financial statistics and ratio analysis of Allcargo Logistics Limited based on Transportation and Logistics Industry. This RMD HTML indicates the financial trend changes over the period of 5 years it may also indicate overall perfoming efficency of the organization. We have done comparative analysis between Allcargo and VRL ltd., also while providing ratio analysis on allcargo we discussed strength and weakness with the help of plots.
#R codes ##Data Loading

#Profit&Loss A/c DATA```{r setup,include=TRUE}
# Load the readxl package
library(readxl)
## Warning: package 'readxl' was built under R version 4.4.3
library(gridExtra)
## Warning: package 'gridExtra' was built under R version 4.4.3
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.4.3
#--------------------------------------
allcargo_pl <- read_excel("E:/fiancial_Analyst/project/allcargo_pl.xlsx")
alcargo_bs <- read_excel("E:/fiancial_Analyst/project/alcargo_bs.xlsx")
## New names:
## • `` -> `...7`
## • `` -> `...8`
## • `` -> `...9`
## • `` -> `...10`
## • `` -> `...11`
## • `` -> `...12`
## • `` -> `...13`
allcargo_cfs <- read_excel("E:/fiancial_Analyst/project/allcargo_cfs.xlsx")

allcargo_pl<-as.data.frame(allcargo_pl)
# Clean column names 
colnames(allcargo_pl) <- make.names(colnames(allcargo_pl))
colnames(allcargo_pl) <- trimws(colnames(allcargo_pl))
#-----------------------------------
# Reshaping the data to long format using reshape function
allcargo_pl_long <- reshape(allcargo_pl, 
                            varying = c("X2024", "X2023", "X2022", "X2021", "X2020"), 
                            v.names = "Amount", 
                            timevar = "Year",
                            times = c("2024","2023","2022","2021", "2020"),
                            direction = "long")
#----------------------------------
# Reset row names if necessary
rownames(allcargo_pl_long) <- NULL



#----------------------------------------------------------------------
#----------------------------------------------------------------------
#Balance sheet
alcargo_bs<-as.data.frame(alcargo_bs)
# Clean column names (if needed)
colnames(alcargo_bs) <- make.names(colnames(alcargo_bs))
colnames(alcargo_bs) <- trimws(colnames(alcargo_bs))
#-----------------------------------
# Reshaping the data to long format using reshape function
alcargo_bs_long <- reshape(alcargo_bs, 
                           varying = c("X2024", "X2023", "X2022", "X2021", "X2020"), 
                           v.names = "Amount", 
                           timevar = "Year",
                           times = c("2024","2023","2022","2021", "2020"),
                           direction = "long")
#----------------------------------
# Reset row names if necessary
rownames(alcargo_bs_long) <- NULL


#--------------------------------------------------------------------------------
#Cash flow statement
allcargo_cfs<-as.data.frame(allcargo_cfs)
# Clean column names (if needed)
colnames(allcargo_cfs) <- make.names(colnames(allcargo_cfs))
colnames(allcargo_cfs) <- trimws(colnames(allcargo_cfs))
#-----------------------------------
# Reshaping the data to long format using reshape function
allcargo_cfs_long <- reshape(allcargo_cfs, 
                             varying = c("X2024", "X2023", "X2022", "X2021", "X2020"), 
                             v.names = "Amount", 
                             timevar = "Year",
                             times = c("2024","2023","2022","2021", "2020"),
                             direction = "long")
#----------------------------------
# Reset row names if necessary
rownames(allcargo_cfs_long) <- NULL


#--------------------------------------
vrl_pl <- read_excel("E:/fiancial_Analyst/project/vrl_pl.xlsx")
vrl_pl<-as.data.frame(vrl_pl)
# Clean column names (if needed)
colnames(vrl_pl) <- make.names(colnames(vrl_pl))
colnames(vrl_pl) <- trimws(colnames(vrl_pl))
#-----------------------------------
# Reshaping the data to long format using reshape function
vrl_pl_long <- reshape(vrl_pl, 
                       varying = c("X2024", "X2023", "X2022", "X2021", "X2020"), 
                       v.names = "Amount", 
                       timevar = "Year",
                       times = c("2024","2023","2022","2021", "2020"),
                       direction = "long")
#----------------------------------
# Reset row names if necessary
rownames(vrl_pl_long) <- NULL

#-----------------------------------------------------------------------------------------------

vrl_bs <- read_excel("E:/fiancial_Analyst/project/vrl_bs.xlsx")
vrl_bs<-as.data.frame(vrl_bs)
# Clean column names (if needed)
colnames(vrl_bs) <- make.names(colnames(vrl_bs))
colnames(vrl_bs) <- trimws(colnames(vrl_bs))
#-----------------------------------
# Reshaping the data to long format using reshape function
vrl_bs_long <- reshape(vrl_bs, 
                       varying = c("X2024", "X2023", "X2022", "X2021", "X2020"), 
                       v.names = "Amount", 
                       timevar = "Year",
                       times = c("2024","2023","2022","2021", "2020"),
                       direction = "long")
#----------------------------------

# Reset row names if necessary
rownames(vrl_bs_long) <- NULL
#-------------------------------------------------------------------------------------------

vrl_cfs <- read_excel("E:/fiancial_Analyst/project/vrl_cfs.xlsx")
vrl_cfs<-as.data.frame(vrl_cfs)
# Clean column names (if needed)
colnames(vrl_cfs) <- make.names(colnames(vrl_cfs))
colnames(vrl_cfs) <- trimws(colnames(vrl_cfs))
#-----------------------------------
# Reshaping the data to long format using reshape function
vrl_cfs_long <- reshape(vrl_cfs, 
                        varying = c("X2024", "X2023", "X2022", "X2021", "X2020"), 
                        v.names = "Amount", 
                        timevar = "Year",
                        times = c("2024","2023","2022","2021", "2020"),
                        direction = "long")
#----------------------------------
# Reset row names if necessary
rownames(vrl_cfs_long) <- NULL
Profit & Loss Analysis of Allcargo Logistics LTD

P&L statement is cleaned and reshaped to be loaded and workings. The plots are the visual representation of the data over the years. P&L statement mainly shows the profitability of the organization and is greatly emphasized in report created by us. It directly affects various ratios.

#---------------------------------
#Split item 1
b1_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS=="RevfromOpr",])

p1_cargo=ggplot(b1_cargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Revenue From Operations",
       caption = "Cleaned by Team",
       subtitle="Allcargo logistics limited (2020 - 2024)")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(1000, 4000),  # Set y-axis limits
    breaks = seq(1000, 4000, by = 1000),  # Set the breaks on the y-axis
    labels = seq(1000, 4000, by = 1000))  # Label the y-axis with values from 1000 to 4000
    grid.arrange(p1_cargo)

#----------------------------------------
#Split item 2
b2_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS == "ExciseServiceTax",])
#-----------------------------------
#Split item 3
b3_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS=="revfromopr_net",])

p3_cargo=ggplot(b3_cargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Revenue From Operations (NET)",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Cleaned by Team")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(1000, 4000),  # Set y-axis limits
    breaks = seq(1000, 4000, by = 1000),  # Set the breaks on the y-axis
    labels = seq(1000, 4000, by = 1000))  
    grid.arrange(p3_cargo)

#-----------------------------------
#Split item 4
b4_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS == "otherOprRev",])

p4_cargo=ggplot(b4_cargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Other Operating Revenues",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Cleaned by Team")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(10, 80),  # Set y-axis limits
    breaks = seq(10,80, by =10), # Set the breaks on the y-axis
    labels = seq(10,80,by =10))
    grid.arrange(p4_cargo)

#-----------------------------------
#Calculation of Total Operating Revenue using user-defined function

alcargo_pl_longT1=allcargo_pl_long[allcargo_pl_long$ITEMS %in% c("revfromopr_net","otherOprRev"),]


by(alcargo_pl_longT1$Amount,
   alcargo_pl_longT1$Year, sum)
## alcargo_pl_longT1$Year: 2020
## [1] 1619.31
## ------------------------------------------------------------ 
## alcargo_pl_longT1$Year: 2021
## [1] 1970.43
## ------------------------------------------------------------ 
## alcargo_pl_longT1$Year: 2022
## [1] 3432.62
## ------------------------------------------------------------ 
## alcargo_pl_longT1$Year: 2023
## [1] 2721.84
## ------------------------------------------------------------ 
## alcargo_pl_longT1$Year: 2024
## [1] 1633.29
result=as.list(by(alcargo_pl_longT1$Amount,
                  alcargo_pl_longT1$Year, sum))
res1=unlist(result)
Total_operating_revenue=data.frame(Year=names(res1),
                     Total=unname(res1))


pT1_cargo=ggplot(Total_operating_revenue,aes(x=Year,y=Total))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Total, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Total Operating Revenue",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Cleaned by Team")+
  geom_text(aes(label = Total), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(1000,4000),  # Set y-axis limits
    breaks = seq(1000,4000, by =500), # Set the breaks on the y-axis
    labels = seq(1000,4000,by =500))
    grid.arrange(pT1_cargo)

#-----------------------------------
#Split item 5
b5_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS == "otherInc",])
#-----------------------------------
#Calculation of Total Income
alcargo_pl_longT2=allcargo_pl_long[allcargo_pl_long$ITEMS %in% c("revfromopr_net","otherOprRev","otherInc"),]

by(alcargo_pl_longT2$Amount,
   alcargo_pl_longT2$Year, sum)
## alcargo_pl_longT2$Year: 2020
## [1] 1735.4
## ------------------------------------------------------------ 
## alcargo_pl_longT2$Year: 2021
## [1] 2154.12
## ------------------------------------------------------------ 
## alcargo_pl_longT2$Year: 2022
## [1] 3676.65
## ------------------------------------------------------------ 
## alcargo_pl_longT2$Year: 2023
## [1] 2817.63
## ------------------------------------------------------------ 
## alcargo_pl_longT2$Year: 2024
## [1] 1856.82
result=as.list(by(alcargo_pl_longT2$Amount,
                  alcargo_pl_longT2$Year, sum))
res2=unlist(result)
Total_revenue=data.frame(Year=names(res2),
                                   Total=unname(res2))


pT2_cargo=ggplot(Total_revenue,aes(x=Year,y=Total))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Total, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Total Revenue",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Cleaned by Team")+
  geom_text(aes(label = Total), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(1000,4000),  # Set y-axis limits
    breaks = seq(1000,4000, by =500), # Set the breaks on the y-axis
    labels = seq(1000,4000,by =500))
    grid.arrange(pT2_cargo)

#-----------------------------------------------
#Split item 6
b6_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS=="CostOfMat_Consumed",])
#----------------------------------------
#Split item 7
b7_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS=="CostOfPowerPurchased",])
#-----------------------------------
#Split item 8
b8_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS=="PurchaseOfStock_In_Trade",])
#-----------------------------------
#Split item 9
b9_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS=="CostOfFuel",])
#-----------------------------------
#Split item 10
b10_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS == "Opr_and_dir_Exp",])

p10_cargo=ggplot(b10_cargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Operating and direct expenses",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Cleaned by Team")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(1000, 4000),  # Set y-axis limits
    breaks = seq(1000,4000, by =1000), # Set the breaks on the y-axis
    labels = seq(1000,4000,by =1000))
    grid.arrange(p10_cargo)

#-----------------------------------
#Split item 11
b11_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS=="ChangesInInven",])
#-----------------------------------
#Split item 12
b12_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS == "EmployeeBenefitExp",])

p12_cargo=ggplot(b12_cargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Employee Benefit Expenses",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Cleaned by Team")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(100, 200),  # Set y-axis limits
    breaks = seq(100,200, by =10), # Set the breaks on the y-axis
    labels = seq(100,200,by =10))
    grid.arrange(p12_cargo)

#-----------------------------------
#Split item 13
b13_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS == "FinCosts",])

p13_cargo=ggplot(b13_cargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Financial Costs",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Cleaned by Team")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(0, 100),  # Set y-axis limits
    breaks = seq(10,100, by =10), # Set the breaks on the y-axis
    labels = seq(10,100,by =10))
    grid.arrange(p13_cargo)

#-----------------------------------
#Split item 14
b14_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS=="ProvisionsandContingencies",])
#-----------------------------------
#Split item 15
b15_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS == "DepAndAmortExp",])

p15_cargo=ggplot(b15_cargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Depreciation And Amortisation Expenses",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Cleaned by Team")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(0, 150),  # Set y-axis limits
    breaks = seq(10,150, by =10), # Set the breaks on the y-axis
    labels = seq(10,150,by =10))
    grid.arrange(p15_cargo)

#-----------------------------------
#Split item 16
b16_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS == "OtherExp",])

p16_cargo=ggplot(b16_cargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Other Expenses",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Cleaned by Team")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(0, 150),  # Set y-axis limits
    breaks = seq(80,150, by =10), # Set the breaks on the y-axis
    labels = seq(80,150,by =10))
    grid.arrange(p16_cargo)

#-----------------------------------
#Split item 17
b17_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS=="InterUnit_Segment_DivisionTransfer",])
#-----------------------------------
#Split item 18
b18_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS=="AmountsTransferToCapiAcc",])
#-----------------------------------
#Split item 19
b19_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS=="Transferto_FromInvestment_FixedAssets_Others",])
#-----------------------------------
#Calculation of Total Expenses
alcargo_pl_longT3=allcargo_pl_long[allcargo_pl_long$ITEMS %in% c("Opr_and_dir_Exp","EmployeeBenefitExp","FinCosts","DepAndAmortExp","OtherExp"),]

by(alcargo_pl_longT3$Amount,
   alcargo_pl_longT3$Year, sum)
## alcargo_pl_longT3$Year: 2020
## [1] 1623
## ------------------------------------------------------------ 
## alcargo_pl_longT3$Year: 2021
## [1] 1951.57
## ------------------------------------------------------------ 
## alcargo_pl_longT3$Year: 2022
## [1] 3304.48
## ------------------------------------------------------------ 
## alcargo_pl_longT3$Year: 2023
## [1] 2597.54
## ------------------------------------------------------------ 
## alcargo_pl_longT3$Year: 2024
## [1] 1650.74
result=as.list(by(alcargo_pl_longT3$Amount,
                  alcargo_pl_longT3$Year, sum))
res3=unlist(result)
Total_expenses=data.frame(Year=names(res3),
                         Total=unname(res3))


pT3_cargo=ggplot(Total_expenses,aes(x=Year,y=Total))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Total, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Total Expenses",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Cleaned by Team")+
  geom_text(aes(label = Total), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(1000,4000),  # Set y-axis limits
    breaks = seq(1000,4000, by =500), # Set the breaks on the y-axis
    labels = seq(1000,4000,by =500))
    grid.arrange(pT3_cargo)

#-----------------------------------
#Split item 20
b20_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS == "PLBeforeExceptional_ExtraOrdinaryItemsAndTax",])

p20_cargo=ggplot(b20_cargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Profit/Loss Before Exceptional, ExtraOrdinary Items And Tax",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Cleaned by Team")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(0, 400),  # Set y-axis limits
    breaks = seq(0,400, by =100), # Set the breaks on the y-axis
    labels = seq(0,400,by =100))
    grid.arrange(p20_cargo)

#-----------------------------------
#Split item 21
b21_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS == "ExceptionalItems",])

p21_cargo=ggplot(b21_cargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Exceptional Items",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Cleaned by Team")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(-10, 200),  # Set y-axis limits
    breaks = seq(-10,160, by =10), # Set the breaks on the y-axis
    labels = seq(-10,160,by =10))
    grid.arrange(p21_cargo)

#-----------------------------------
#Calculation of Profit/loss before tax
alcargo_pl_longT4=allcargo_pl_long[allcargo_pl_long$ITEMS %in% c("PLBeforeExceptional_ExtraOrdinaryItemsAndTax","ExceptionalItems"),]


by(alcargo_pl_longT4$Amount,
   alcargo_pl_longT4$Year, sum)
## alcargo_pl_longT4$Year: 2020
## [1] 266.04
## ------------------------------------------------------------ 
## alcargo_pl_longT4$Year: 2021
## [1] 199.05
## ------------------------------------------------------------ 
## alcargo_pl_longT4$Year: 2022
## [1] 426.28
## ------------------------------------------------------------ 
## alcargo_pl_longT4$Year: 2023
## [1] 259.96
## ------------------------------------------------------------ 
## alcargo_pl_longT4$Year: 2024
## [1] 231.43
result=as.list(by(alcargo_pl_longT4$Amount,
                  alcargo_pl_longT4$Year, sum))
res4=unlist(result)
Profit_loss_before_tax=data.frame(Year=names(res4),
                                   Total=unname(res4))


pT4_cargo=ggplot(Profit_loss_before_tax,aes(x=Year,y=Total))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Total, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Profit/Loss Before Tax",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Cleaned by Team")+
  geom_text(aes(label = Total), vjust = -1, color = "black")+ 
  scale_y_continuous(
    limits = c(100,500),  # Set y-axis limits
    breaks = seq(100,500, by =100), # Set the breaks on the y-axis
    labels = seq(100,500,by =100))
    grid.arrange(pT4_cargo)

#-----------------------------------
#Split item 22
b22_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS == "CurrentTax",])

p22_cargo=ggplot(b22_cargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Current Tax",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Cleaned by Team")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(0, 120),  # Set y-axis limits
    breaks = seq(0,150, by =10), # Set the breaks on the y-axis
    labels = seq(0,150,by =10))
    grid.arrange(p22_cargo)

#-----------------------------------
#Split item 23
b23_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS=="MAT_CreditEntitlement",])
#-----------------------------------
#Split item 24
b24_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS == "DeferredTax",])

p24_cargo=ggplot(b24_cargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Deferred Tax",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Cleaned by Team")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(-50, 50),  # Set y-axis limits
    breaks = seq(-50,50, by =10), # Set the breaks on the y-axis
    labels = seq(-50,50,by =10))
    grid.arrange(p24_cargo)

#-----------------------------------
#Split item 25
b25_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS=="TaxForEarlierYears",])
#-----------------------------------
#Calculation for Total Tax Expenses
alcargo_pl_longT5=allcargo_pl_long[allcargo_pl_long$ITEMS %in% c("CurrentTax","DeferredTax"),]


by(alcargo_pl_longT5$Amount,
   alcargo_pl_longT5$Year, sum)
## alcargo_pl_longT5$Year: 2020
## [1] 46.29
## ------------------------------------------------------------ 
## alcargo_pl_longT5$Year: 2021
## [1] 7.7
## ------------------------------------------------------------ 
## alcargo_pl_longT5$Year: 2022
## [1] 61.1
## ------------------------------------------------------------ 
## alcargo_pl_longT5$Year: 2023
## [1] 57.33
## ------------------------------------------------------------ 
## alcargo_pl_longT5$Year: 2024
## [1] 30.83
result=as.list(by(alcargo_pl_longT5$Amount,
                  alcargo_pl_longT5$Year, sum))
res5=unlist(result)
Total_Tax_Expenses=data.frame(Year=names(res5),
                                  Total=unname(res5))


pT5_cargo=ggplot(Total_Tax_Expenses,aes(x=Year,y=Total))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Total, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Total Tax Expenses",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Cleaned by Team")+
  geom_text(aes(label = Total), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(0,100),  # Set y-axis limits
    breaks = seq(0,100, by =10), # Set the breaks on the y-axis
    labels = seq(0,100,by =10))
    grid.arrange(pT5_cargo)

#-----------------------------------
#Split item 26
b26_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS=="PL_AfterTaxAndBeforeExtraOrdinaryItems",])

p26_cargo=ggplot(b26_cargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Profit/Loss After Tax And Before ExtraOrdinary Items",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Cleaned by Team")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(100, 400),  # Set y-axis limits
    breaks = seq(100,400, by =100), # Set the breaks on the y-axis
    labels = seq(100,400,by =100))
    grid.arrange(p26_cargo)

#-----------------------------------
#Split item 27
b27_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS == "PL_FromContinuingOperations",])

p27_cargo=ggplot(b27_cargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Profit/Loss From Continuing Operations",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Cleaned by Team")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(100, 400),  # Set y-axis limits
    breaks = seq(100,400, by =100), # Set the breaks on the y-axis
    labels = seq(100,400,by =100))
    grid.arrange(p27_cargo)

#-----------------------------------
#Split item 28
b28_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS=="PL_FromDiscontinuingOperations",])
#-----------------------------------
#Split item 29
b29_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS=="TotalTaxExpensesDiscontinuingOperations",])
#-----------------------------------
#Split item 30
b30_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS == "NetProfitLoss_FromDiscontinuingOperations",])

p30_cargo=ggplot(b30_cargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in cr's",
       title="Net Profit & Loss From Discontinuing Operations",
       subtitle="ALLCARGO LOGISTICS (2020 - 2024)",
       caption = "Cleaned by TEAM")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(-10, 10),  # Set y-axis limits
    breaks = seq(-10, 10, by = 2),  # Set the breaks on the y-axis
    labels = seq(-10, 10, by = 2)) 
    grid.arrange(p30_cargo)

#-----------------------------------------------
#Calculation for Profit/loss for the period
alcargo_pl_longT6=allcargo_pl_long[allcargo_pl_long$ITEMS %in% c("PL_AfterTaxAndBeforeExtraOrdinaryItems","PL_FromDiscontinuingOperations"),]


by(alcargo_pl_longT6$Amount,
   alcargo_pl_longT6$Year, sum)
## alcargo_pl_longT6$Year: 2020
## [1] 219.75
## ------------------------------------------------------------ 
## alcargo_pl_longT6$Year: 2021
## [1] 191.35
## ------------------------------------------------------------ 
## alcargo_pl_longT6$Year: 2022
## [1] 367.16
## ------------------------------------------------------------ 
## alcargo_pl_longT6$Year: 2023
## [1] 203.34
## ------------------------------------------------------------ 
## alcargo_pl_longT6$Year: 2024
## [1] 202.98
result=as.list(by(alcargo_pl_longT6$Amount,
                  alcargo_pl_longT6$Year, sum))
res6=unlist(result)
Profit_Loss_For_The_Period=data.frame(Year=names(res6),
                              Total=unname(res6))


pT6_cargo=ggplot(Profit_Loss_For_The_Period,aes(x=Year,y=Total))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Total, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Profit/loss for the period",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Cleaned by Team")+
  geom_text(aes(label = Total), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(100,400),  # Set y-axis limits
    breaks = seq(100,400, by =100), # Set the breaks on the y-axis
    labels = seq(100,400,by =100))
    grid.arrange(pT6_cargo)

#-----------------------------------------------
#Split item 31
b31_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS == "BasicEPS",])

p31_cargo=ggplot(b31_cargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in cr's",
       title="Basic EPS (Rs.)",
       subtitle="ALLCARGO LOGISTICS (2020 - 2024)",
       caption = "Cleaned by TEAM")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(0, 20),  # Set y-axis limits
    breaks = seq(0, 20, by = 2),  # Set the breaks on the y-axis
    labels = seq(0, 20, by = 2))  
    grid.arrange(p31_cargo)

#-----------------------------------------------
#Split item 32
b32_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS == "DilutedEPS",])

p32_cargo=ggplot(b32_cargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in cr's",
       title="Diluted EPS (Rs.)",
       subtitle="ALLCARGO LOGISTICS limited (2020 - 2024)",
       caption = "Cleaned by TEAM")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(0, 20),  # Set y-axis limits
    breaks = seq(0, 20, by = 2),  # Set the breaks on the y-axis
    labels = seq(0, 20, by = 2))  
    grid.arrange(p32_cargo)

#-----------------------------------
#Split item 33
b33_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS=="ImportedRawMaterials",])
#-----------------------------------
#Split item 34
b34_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS=="IndigenousRawMaterials",])
#-----------------------------------
#Split item 35
b35_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS=="ImportedStoresAndSpares",])
#-----------------------------------
#Split item 36
b36_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS=="IndigenousStoresAndSpares",])
#-----------------------------------
#Split item 37_
b37_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS == "EquityShareDividend",])

p37_cargo=ggplot(b37_cargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in cr's",
       title="Equity Share Dividend",
       subtitle="ALLCARGO LOGISTICS (2020 - 2024)",
       caption = "Cleaned by TEAM")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(-10,100),  # Set y-axis limits
    breaks = seq(-10,100, by = 10),  # Set the breaks on the y-axis
    labels = seq(-10,100, by = 10))  
    grid.arrange(p37_cargo)

#-----------------------------------
#Split item 38
b38_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS == "TaxOnDividend",])

p38_cargo=ggplot(b38_cargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in cr's",
       title="Tax On Dividend",
       caption = "Cleaned by TEAM",
       subtitle="ALLCARGO LOGISTICS (2020 - 2024)")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(0, 20),  # Set y-axis limits
    breaks = seq(0, 20, by = 2),  # Set the breaks on the y-axis
    labels = seq(0, 20, by = 2))  # Label the y-axis with values from 50 to 80
    grid.arrange(p38_cargo)

#-----------------------------------
#Split item 39
b39_cargo=as.data.frame(allcargo_pl_long[allcargo_pl_long$ITEMS=="EquityDividendRate",])

p39_cargo=ggplot(b39_cargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in cr's",
       title="Equity Dividend Rate (%)",
       caption = "Cleaned by TEAM",
       subtitle="ALLCARGO LOGISTICS (2020 - 2024)")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(0,200),  # Set y-axis limits
    breaks = seq(0,200, by = 20),  # Set the breaks on the y-axis
    labels = seq(0,200, by = 20))  # Label the y-axis with values from 50 to 80
    grid.arrange(p39_cargo)

Balance Sheet Analysis of Allcargo Logistics LTD
    Data provided in drive is cleaned and formatted to be able to analysed by R. These plots represents the trend of changes in respective variables over the years.Codes are provided for each and every individual variables with or without plots (Depending on the necessity). Data in Balance sheet mainly shows financial stability i.e liquidity and solvency of the organization. 
#----------------------------------
bs1_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items=="Eq_ShareCap",])

p1_alcargo=ggplot(bs1_alcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Equity Share Capital",
       caption = "Created by Team Logistics",
       subtitle="Allcargo logistics limited (2020 - 2024)")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(0, 200),  # Set y-axis limits
    breaks = seq(0, 200, by = 50),  # Set the breaks on the y-axis
    labels = seq(0, 200, by = 50))  # Label the y-axis with values from 50 to 80
    grid.arrange(p1_alcargo)

#----------------------------------
#Split item 2
bs2_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items=="Pref_Share_Cap",])
#----------------------------------
#Find the Total share capital from 
tot_sh_cap_alcargo_bs=rbind(bs1_alcargo,bs2_alcargo)


tot_sh_cap_alcargo_bs=aggregate(Amount ~ Year , 
                                data = tot_sh_cap_alcargo_bs, 
                                FUN = sum)
pTot1_cargo=ggplot(tot_sh_cap_alcargo_bs,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="TOTAL SHARE CAPITAL ",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(0,200),  # Set y-axis limits
    breaks = seq(0,200, by =20), # Set the breaks on the y-axis
    labels = seq(0,200,by =20))                              
    grid.arrange(pTot1_cargo)

#----------------------------------
#Split item 3
bs3_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items=="Revaluation_Reserv",])
#----------------------------------
#Split item 4
bs4_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items=="ReserveandSurplus",])

p4_alcargo=ggplot(bs4_alcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Reserve and Surplus",
       caption = "Created by Team Logistics",
       subtitle="Allcargo logistics limited (2020 - 2024)")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(500, 2000),  # Set y-axis limits
    breaks = seq(500, 2000, by = 500),  # Set the breaks on the y-axis
    labels = seq(500, 2000, by = 500))  # Label the y-axis with values from 50 to 80
    grid.arrange(p4_alcargo)

#----------------------------------
#Split item 5
bs5_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items=="EmployeesStockOptions",])
#----------------------------------
#Split item 6
bs6_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items=="MoneyReceivedAgainst_ShWarrant",])
#----------------------------------
#Split item 7
bs7_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items=="Eq_Sh_ApplicationMoney",])
#---------------------------------
#Split item 8
bs8_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items=="Hybrid_Debt_OtherSecuritie",])
#----------------------------------------

#Split item 9
bs9_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "Sh_Cap_Suspense",])
#----------------------------------------
#Split item 10
bs10_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "Lg_TM_Borrowing",])

p10_alcargo=ggplot(bs10_alcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Long Term Borrowings",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(100, 500),  # Set y-axis limits
    breaks = seq(100, 500, by = 100),  # Set the breaks on the y-axis
    labels = seq(100, 500, by = 100))
    grid.arrange(p10_alcargo)

#-----------------------------------

#Split item 11
bs11_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "Deferred_Tax_Liabilities_Net",])
#-----------------------------------

#Split item 12
bs12_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "Oth_Lg_Tm_Liab",])

p12_alcargo=ggplot(bs12_alcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Other Long Term Liabilities",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(0, 100),  # Set y-axis limits
    breaks = seq(0, 100, by =10), # Set the breaks on the y-axis
    labels = seq(0, 100,by =10))
    grid.arrange(p12_alcargo)

#-----------------------------------

#Split item 13
bs13_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "Lg Tm Provisions",])
#Split item 14
bs14_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "Sh_TM_Borrowings",])

p14_alcargo=ggplot(bs14_alcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Short Term Borrowings",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(0, 500),  # Set y-axis limits
    breaks = seq(0, 500, by =50), # Set the breaks on the y-axis
    labels = seq(0, 500,by =50))
    grid.arrange(p14_alcargo)

#-----------------------------------
#Split item 15
bs15_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "Trade_Payables",])

p15_alcargo=ggplot(bs15_alcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Trade Payables",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(100, 600),  # Set y-axis limits
    breaks = seq(100, 600, by =100), # Set the breaks on the y-axis
    labels = seq(100, 600,by =100))
    grid.arrange(p15_alcargo)

#---------------------------------
#Split item 16
bs16_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items=="Oth_CurR_Liab",])

p16_alcargo=ggplot(bs16_alcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Other Current Liabilities",
       caption = "Created by Team Logistics",
       subtitle="Allcargo Logistics limited (2020 - 2024)")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(100, 500),  # Set y-axis limits
    breaks = seq(100, 500, by = 100),  # Set the breaks on the y-axis
    labels = seq(100, 500, by = 100))  # Label the y-axis with values from 50 to 80
    grid.arrange(p16_alcargo)

#----------------------------------------
#Split item 17
bs17_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "Sh_Tm_Provi",])
#-----------------------------------
#Split item 18
bs18_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "Tan_Asset",])

p18_alcargo=ggplot(bs18_alcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Tangible Assets",
       subtitle="Allcargo Logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(50, 750),  # Set y-axis limits
    breaks = seq(50, 750, by = 100),  # Set the breaks on the y-axis
    labels = seq(50, 750, by = 100))  
    grid.arrange(p18_alcargo)

#-----------------------------------
#Split item 19
bs19_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "Intan_Asset",])

p19_alcargo=ggplot(bs19_alcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Intangible Assets",
       subtitle="Allcargo Logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(0, 3),  # Set y-axis limits
    breaks = seq(0, 3, by = 0.5),  # Set the breaks on the y-axis
    labels = seq(0, 3, by = 0.5))  
    grid.arrange(p19_alcargo)

#-----------------------------------
#Split item 20
bs20_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "Cap_Work_In_Progress",])

p20_alcargo=ggplot(bs20_alcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Capital Work-In-Progress",
       subtitle="Allcargo Logistics limited(2020 - 2024)",
       caption = "Created by Team Logistics")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(1, 20),  # Set y-axis limits
    breaks = seq(1, 20, by = 1),  # Set the breaks on the y-axis
    labels = seq(1, 20, by = 1))
    grid.arrange(p20_alcargo)

#---------------------------------
#Split item 21
bs21_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items=="Intang_Asset_Under_Development",])

p21_alcargo=ggplot(bs21_alcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Intangible Assets Under Developments",
       caption = "Created by Team Logistics",
       subtitle="Allcargo Logistics limited (2020 - 2024)")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(0, 1),  # Set y-axis limits
    breaks = seq(0, 1, by = 0.5),  # Set the breaks on the y-axis
    labels = seq(0, 1, by = 0.5))  # Label the y-axis with values from 50 to 80
    grid.arrange(p21_alcargo)

#----------------------------------------
#Split item 22
bs22_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "Oth_Asset",])
#-----------------------------------
#Split item 23
bs23_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "FD_Asset",])

p23_alcargo=ggplot(bs23_alcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Fixed Assets",
       subtitle="Allcargo Logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(50, 750),  # Set y-axis limits
    breaks = seq(50, 750, by = 50),  # Set the breaks on the y-axis
    labels = seq(50, 750, by = 50))  
    grid.arrange(p23_alcargo)

#-----------------------------------
#Split item 24
bs24_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "Non_Curr_Invest",])

p24_alcargo=ggplot(bs24_alcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in 00's",
       title="Non-Current Investments",
       subtitle="Allcargo Logistics limited(2020 - 2024)",
       caption = "Created by Team Logistics")+
  geom_text(aes(label = Amount), vjust = -1, color = "black")+  # Display numbers above points
  scale_y_continuous(
    limits = c(500, 2000),  # Set y-axis limits
    breaks = seq(500, 2000, by = 500),  # Set the breaks on the y-axis
    labels = seq(500, 2000, by = 500)) 
    grid.arrange(p24_alcargo)

#-----------------------------------
#Split item 25
bs25_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "DeferredTaxAsset_Net",])

p25_alcargo=ggplot(bs25_alcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Deferred Tax Assets [Net]",
       subtitle=" Allcargo Logistics limited(2020 - 2024)",
       caption = "Created by Team Logistics")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(10, 100),  # Set y-axis limits
    breaks = seq(10, 100, by = 10),  # Set the breaks on the y-axis
    labels = seq(10, 100, by = 10))
    grid.arrange(p25_alcargo)

#-----------------------------------
#Split item 26
bs26_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "Lg_Tm_LoansAndAdvanc",])

p26_alcargo=ggplot(bs26_alcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Long Term Loans and Advances",
       subtitle=" Allcargo Logistics limited(2020 - 2024)",
       caption = "Created by Team Logistics")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(0, 300),  # Set y-axis limits
    breaks = seq(0, 300, by =50 ),  # Set the breaks on the y-axis
    labels = seq(0, 300, by = 50))
    grid.arrange(p26_alcargo)

#-----------------------------------
#Split item 27
bs27_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "Oth_Non_Curr_ Asset",])

p27_alcargo=ggplot(bs27_alcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Other Non CUrrent Asset",
       subtitle=" Allcargo Logistics limited(2020 - 2024)",
       caption = "Created by Team Logistics")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(10, 100),  # Set y-axis limits
    breaks = seq(10, 100, by = 10),  # Set the breaks on the y-axis
    labels = seq(10, 100, by = 10))
    grid.arrange(p27_alcargo)

#-----------------------------------
#Split item 28
bs28_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "Curr_Invest",])

p28_alcargo=ggplot(bs28_alcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Current Investment",
       subtitle=" Allcargo Logistics limited(2020 - 2024)",
       caption = "Created by Team Logistics")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(0, 200),  # Set y-axis limits
    breaks = seq(0, 200, by = 10),  # Set the breaks on the y-axis
    labels = seq(0, 200, by = 10))
    grid.arrange(p28_alcargo)

#-----------------------------------
#Split item 29
bs29_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "Inventories",])

p29_alcargo=ggplot(bs29_alcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Inventories",
       subtitle=" Allcargo Logistics limited(2020 - 2024)",
       caption = "Created by Team Logistics")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(0, 200),  # Set y-axis limits
    breaks = seq(0, 200, by = 10),  # Set the breaks on the y-axis
    labels = seq(0, 200, by = 10))
    grid.arrange(p29_alcargo)

#---------------------------------------
#Split item 30

bs30_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "Trade_Receiva",])

p30_alcargo=ggplot(bs30_alcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Trade Receivables",
       subtitle="alcargo logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(100, 700),  # Set y-axis limits
    breaks = seq(100,700, by = 100),  # Set the breaks on the y-axis
    labels = seq(100,700, by = 100))  
    grid.arrange(p30_alcargo)

#---------------------------------------
#Split item 31

bs31_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "CashAndCash_Equi",])

p31_alcargo=ggplot(bs31_alcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Cash And Cash Equivalents",
       subtitle="alcargo logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(0, 100),  # Set y-axis limits
    breaks = seq(0, 100, by = 20),  # Set the breaks on the y-axis
    labels = seq(0,100, by = 20))  
    grid.arrange(p31_alcargo)

#---------------------------------------
#Split item 32

bs32_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "Sh_Tm_LoansAnd Advanc",])

p32_alcargo=ggplot(bs32_alcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Short Term Loans And Advances",
       subtitle="alcargo logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(0, 10),  # Set y-axis limits
    breaks = seq(0, 10, by = 1),  # Set the breaks on the y-axis
    labels = seq(0,10, by = 1))  
    grid.arrange(p32_alcargo)

#---------------------------------------
#Split item 33

bs33_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "Oth_Curr_Assets",])

p33_alcargo=ggplot(bs33_alcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Other Current Assets",
       subtitle="alcargo logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(0, 500),  # Set y-axis limits
    breaks = seq(0, 500, by = 100),  # Set the breaks on the y-axis
    labels = seq(0,500, by = 100))  
    grid.arrange(p33_alcargo)

#----------------------------------------
#Alternate way for sum
#Find the Total current asset from 
tot_curr_asset_alcargo_bs=rbind(bs28_alcargo,bs29_alcargo,bs30_alcargo,bs31_alcargo,bs32_alcargo,bs33_alcargo)
tot_curr_asset_alcargo_bs=aggregate(Amount ~ Year , 
                                    data = tot_curr_asset_alcargo_bs, 
                                    FUN = sum)

#----------------------------------------
#Split item 34

bs34_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "Contingent_Liab",])

p34_alcargo=ggplot(bs34_alcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Contingent Liabilities",
       subtitle="alcargo logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(0, 1200),  # Set y-axis limits
    breaks = seq(0, 1200, by = 200),  # Set the breaks on the y-axis
    labels = seq(0,1200, by = 200))  
    grid.arrange(p34_alcargo)

#----------------------------------------
#Split item 35

bs35_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "Raw_Materia",])
#----------------------------------------
#Split item 36
bs36_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "Stores_SparesAndLoose_Tools",])
#----------------------------------------
#Split item 37
bs37_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "Trade_Other_Goods",])
#----------------------------------------
#Split item 38
bs38_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "Capi_Goods",])
#----------------------------------------
#Split item 39
bs39_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "Expendi_In_Foreign_Currency",])

p39_alcargo=ggplot(bs39_alcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Expenditure In Foreign Currency",
       subtitle="alcargo logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(0, 1000),  # Set y-axis limits
    breaks = seq(0, 1000, by = 100),  # Set the breaks on the y-axis
    labels = seq(0,1000, by = 100))  
    grid.arrange(p39_alcargo)

#----------------------------------------

#Split item 40
bs40_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items == "Oth_Earni",])

p40_alcargo=ggplot(bs40_alcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Other Earnings",
       subtitle="alcargo logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(100, 800),  # Set y-axis limits
    breaks = seq(100, 800, by = 100),  # Set the breaks on the y-axis
    labels = seq(100, 800, by = 100)) 
    grid.arrange(p40_alcargo)

#----------------------------------------
#Split item 41
bs41_alcargo=as.data.frame(alcargo_bs_long[alcargo_bs_long$Items=="Bonus_Equ_Sh_Cap",])

p41_alcargo=ggplot(bs41_alcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Bonus Equity Share Capital",
       caption = "Created by Team Logistics",
       subtitle="alcargo logistics limited (2020 - 2024)")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(0, 200),  # Set y-axis limits
    breaks = seq(0, 200, by = 20),  # Set the breaks on the y-axis
    labels = seq(0, 200, by = 20))  # Label the y-axis with values from 0 to 200
    grid.arrange(p41_alcargo)

<>head> Cash flow statement of Allcargo Logistics LTD
     Data provided in cash flow statement is cleaned, reshaped and loaded into R. The plots represented under CSF shows the trend of changes in each and every variables over the years. Cash flow statement highly emphasizes the inflow and outflow of cash in the organization.
#---------------------------------
#Split item 1
c1_allcargo=as.data.frame(allcargo_cfs_long[allcargo_cfs_long$items=="npbt",])

p1_allcargo=ggplot(c1_allcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Net Profit Before Tax",
       caption = "Created by Team Logistics",
       subtitle="Allcargo logistics limited (2020 - 2024)")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(100, 500),  # Set y-axis limits
    breaks = seq(100, 500, by = 100),  # Set the breaks on the y-axis
    labels = seq(100, 500, by = 100))  # Label the y-axis with values from 100 to 500
    grid.arrange(p1_allcargo)

#----------------------------------------

#Split item 2
c2_allcargo=as.data.frame(allcargo_cfs_long[allcargo_cfs_long$items == "NetCashFromOperActiv",])

p2_allcargo=ggplot(c2_allcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Net Cash From Operating Activities",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(-200, 500),  # Set y-axis limits
    breaks = seq(-200, 500, by = 100),  # Set the breaks on the y-axis
    labels = seq(-200, 500, by = 100))
    grid.arrange(p2_allcargo)

#-----------------------------------

#Split item 3
c3_allcargo=as.data.frame(allcargo_cfs_long[allcargo_cfs_long$items == "NetCashfromInvestingActiv",])

p3_allcargo=ggplot(c3_allcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Net Cash(used in)/from Investing Activities",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(-600, 300),  # Set y-axis limits
    breaks = seq(-600, 300, by =100), # Set the breaks on the y-axis
    labels = seq(-600, 300,by =100))
    grid.arrange(p3_allcargo)

#-----------------------------------

#Split item 4
c4_allcargo=as.data.frame(allcargo_cfs_long[allcargo_cfs_long$items == "NetCashfromFinActiv",])

p4_allcargo=ggplot(c4_allcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Net Cash(used in)/from Financing Activities",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(-500, 400),  # Set y-axis limits
    breaks = seq(-500, 400, by =100), # Set the breaks on the y-axis
    labels = seq(-500, 400,by =100))
    grid.arrange(p4_allcargo)

#-----------------------------------

#Split item 5
c5_allcargo=as.data.frame(allcargo_cfs_long[allcargo_cfs_long$items == "Netdec_inc_In_CashandCashEquiv",])

p5_allcargo=ggplot(c5_allcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Net (decrease)/increase In Cash and Cash Equivalents",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(-60, 100),  # Set y-axis limits
    breaks = seq(-60, 100, by =20), # Set the breaks on the y-axis
    labels = seq(-60, 100,by =20))
    grid.arrange(p5_allcargo)

#-----------------------------------

#Split item 6
c6_allcargo=as.data.frame(allcargo_cfs_long[allcargo_cfs_long$items == "Op_Cash_CashEquiv",])

p6_allcargo=ggplot(c6_allcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Opening Cash & Cash Equivalents",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(0, 100),  # Set y-axis limits
    breaks = seq(0, 100, by =10), # Set the breaks on the y-axis
    labels = seq(0, 100,by =10))
    grid.arrange(p6_allcargo)

#-----------------------------------

#Split item 7
c7_allcargo=as.data.frame(allcargo_cfs_long[allcargo_cfs_long$items == "Cl_Cash_Cash Equiv",])

p7_allcargo=ggplot(c7_allcargo,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Closing Cash & Cash Equivalents",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  geom_text(aes(label = Amount), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
    limits = c(0, 100),  # Set y-axis limits
    breaks = seq(0, 100, by =10), # Set the breaks on the y-axis
    labels = seq(0, 100,by =10))
    grid.arrange(p7_allcargo)

#——————————————

RATIOS CALCULATION

Activity ratio

Activity ratios measure how effectively a company uses its assets and resources to operate and generate revenue. These ratios help businesses evaluate their efficiency in managing assets like inventory, receivables, and fixed assets. They act as indicators of how "busy" or "productive" the business is in using what it owns.
#1 Trade Receivable turnover ratio
#Define groups from the items
num <-  c("revfromopr_net")  
den  <- c("Trade_Receiva")      

#Finding the sum of items in each group year wise
sum_num = tapply(allcargo_pl_long$Amount[allcargo_pl_long$ITEMS %in% num], allcargo_pl_long$Year[allcargo_pl_long$ITEMS %in% num], sum)
sum_den = tapply(alcargo_bs_long$Amount[alcargo_bs_long$Item %in% den], alcargo_bs_long$Year[alcargo_bs_long$Item %in% den], mean)

#Finding the ratio of sum in each group - year wise
trade_receivable_turnover_ratio <- sum_num / sum_den 

#creating dataframe
r1_ratio <- data.frame(
  Year = names(trade_receivable_turnover_ratio),
  Ratio = as.numeric(trade_receivable_turnover_ratio))

r1_ratio$Year <- as.numeric(r1_ratio$Year)

rp1_allcargo <- ggplot(r1_ratio, aes(x = Year, y = Ratio)) +
      geom_point(color = "black", size = 6) +
      geom_line(color = "blue", size =2) +
      labs(
    x = "Year",
    y = "Trade Receivable Turnover Ratio",
    title = "Trade Receivable Turnover Ratio Over Years")+
    geom_text(aes(label = round(Ratio,2)), vjust = -1, color = "black")+  # Display numbers above points
    scale_y_continuous(
    limits = c(0, 10),  # Set y-axis limits
    breaks = seq(0, 10, by =1), # Set the breaks on the y-axis
    labels = seq(0, 10,by =1))
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
   grid.arrange(rp1_allcargo)

#--------------------------------------------

#2 Fixed Asset turnover ratio
#Define groups from the items
nr <-  c("revfromopr_net")  
dr  <- c("FD_Asset")      

#Finding the sum of items in each group year wise
sum_nr = tapply(allcargo_pl_long$Amount[allcargo_pl_long$ITEMS %in% nr], allcargo_pl_long$Year[allcargo_pl_long$ITEMS %in% nr], sum)
sum_dr = tapply(alcargo_bs_long$Amount[alcargo_bs_long$Item %in% dr], alcargo_bs_long$Year[alcargo_bs_long$Item %in% dr], mean)

#Finding the ratio of sum in each group - year wise
fixed_asset_turnover_ratio <- sum_nr / sum_dr 

#creating dataframe
r2_ratio <- data.frame(
  Year = names(fixed_asset_turnover_ratio),
  Ratio = as.numeric(fixed_asset_turnover_ratio))

r2_ratio$Year <- as.numeric(r2_ratio$Year)

rp2_allcargo <- ggplot(r2_ratio, aes(x = Year, y = Ratio)) +
  geom_point(color = "black", size = 6) +
  geom_line(color = "blue", size =2) +
  labs(
    x = "Year",
    y = "Fixed Asset Turnover Ratio",
    title = "Fixed Asset Turnover Ratio Over Years")+
    geom_text(aes(label = round(Ratio,2)), vjust = -1, color = "black") +  # Display numbers above points
    scale_y_continuous(
    limits = c(0, 36),  # Set y-axis limits
    breaks = seq(0, 36, by =2), # Set the breaks on the y-axis
    labels = seq(0, 36,by =2))
    grid.arrange(rp2_allcargo)

#--------------------------------------------

#3 Total Asset turnover ratio
#Define groups from the items
nr1 <-  c("revfromopr_net")  
dr1  <- c("Tan_Asset","Intan_Asset","Cap_Work_In_Progress","Non_Curr_Invest","DeferredTaxAsset_Net","Lg_Tm_LoansAndAdvanc","Oth_Non_Curr_ Asset","Curr_Invest","Inventories","Trade_Receiva","CashAndCash_Equi","Sh_Tm_LoansAnd Advanc","Oth_Curr_Assets")      

#Finding the sum of items in each group year wise
sum_nr1 = tapply(allcargo_pl_long$Amount[allcargo_pl_long$ITEMS %in% nr1], allcargo_pl_long$Year[allcargo_pl_long$ITEMS %in% nr1], sum)
sum_dr1 = tapply(alcargo_bs_long$Amount[alcargo_bs_long$Item %in% dr1], alcargo_bs_long$Year[alcargo_bs_long$Item %in% dr1], sum)

#Finding the ratio of sum in each group - year wise#Finding the ratio of sum in each group - year wisesum
total_asset_turnover_ratio <- sum_nr1 / sum_dr1 

#creating dataframe
r3_ratio <- data.frame(
  Year = names(total_asset_turnover_ratio),
  Ratio = as.numeric(total_asset_turnover_ratio))

r3_ratio$Year <- as.numeric(r3_ratio$Year)

rp3_allcargo <- ggplot(r3_ratio, aes(x = Year, y = Ratio)) +
  geom_point(color = "black", size = 6) +
  geom_line(color = "blue", size =2) +
  labs(
    x = "Year",
    y = "Total Asset turnover ratio",
    title = "Total Asset turnover ratio Over Years")+
    geom_text(aes(label = round(Ratio,2)), vjust = -1, color = "black")+  # Display numbers above points
    scale_y_continuous(
    limits = c(0, 2),  # Set y-axis limits
    breaks = seq(0, 2, by =0.10), # Set the breaks on the y-axis
    labels = seq(0, 2,by =0.10))
    grid.arrange(rp3_allcargo)

Liquidity ratio

Liquidity ratios measure a company's ability to meet its short-term financial obligations, like paying bills or repaying loans, using its liquid assets—those that can be quickly converted to cash. These ratios show how financially healthy and stable a business is in the short run.
#--------------------------------------------
#4 Current ratio
#Define groups from the items
current_assets <- c("Curr_Invest","Inventories","Trade_Receiva","CashAndCash_Equi","Sh_Tm_LoansAnd Advanc","Oth_Curr_Assets")  
current_liabilities <- c("Sh_TM_Borrowings","Trade_Payables","Oth_CurR_Liab","Sh_Tm_Provi")      

#Finding the sum of items in each group year wise
sum_current_assets = tapply(alcargo_bs_long$Amount[alcargo_bs_long$Item %in% current_assets], alcargo_bs_long$Year[alcargo_bs_long$Item %in% current_assets], sum)
sum_current_liabilities = tapply(alcargo_bs_long$Amount[alcargo_bs_long$Item %in% current_liabilities], alcargo_bs_long$Year[alcargo_bs_long$Item %in% current_liabilities], sum)

#Finding the ratio of sum in each group - yearwise
current_ratio <- sum_current_assets / sum_current_liabilities

#creating dataframe
r4_ratio <- data.frame(
  Year = names(current_ratio),
  Ratio = as.numeric(current_ratio))

r4_ratio$Year <- as.numeric(r4_ratio$Year)

rp4_allcargo <- ggplot(r4_ratio, aes(x = Year, y = Ratio)) +
  geom_point(color = "black", size = 6) +
  geom_line(color = "blue", size =2) +
  labs(
    x = "Year",
    y = "Current ratio",
    title = "Current ratio for the years")+
    geom_text(aes(label = round(Ratio,2)), vjust = -1, color = "black")+  # Display numbers above points
    scale_y_continuous(
    limits = c(0, 2),  # Set y-axis limits
    breaks = seq(0, 2, by =0.10), # Set the breaks on the y-axis
    labels = seq(0, 2,by =0.10))
    grid.arrange(rp4_allcargo)

Current Ratio

Strengths:
1. In 2023, the ratio improved above parity, hinting at an instance where the company managed its working capital better.

Weaknesses:
1. The consistent trend of ratios near or below 1 in 2020, 2021, 2022, and again in 2024 signals a potential liquidity stress.
2. Low absolute levels of cash (for instance, only 19.63 in 2024 versus higher levels in earlier years) further underscore the risk that the firm might face short-term funding challenges.

#--------------------------------------------
#5 Quick Ratio== (cash+short-term Marketable Investment+ receivables) / current liabilities

allcargo_pl_longq_r<-data.frame(year = c(2020,2021,2022,2023,2024),
                                CashAndCash_Equi=c(48.38,41.06,76.71,82.4,19.63),
                                Curr_Invest=c(5.02,29.03,134.69,169.85,0),
                                Trade_Receiva=c(314.11,558,633.32,315.27,454.04),
                                tot_curr_liab=c(897.73,1223.54,1201.60,592.74,799.98))
#calculate cash and sh_t investment
allcargo_pl_longq_r$cash_and_sh_invest_rec <- allcargo_pl_longq_r$CashAndCash_Equi+allcargo_pl_longq_r$Curr_Invest+allcargo_pl_longq_r$Trade_Receiva
#calculate cash ratio
Quick_ratio <-(allcargo_pl_longq_r$cash_and_sh_invest_rec  / allcargo_pl_longq_r$tot_curr_liab)

# Create a dataframe for Quick Ratio
r5_allcargo_long<- data.frame(Year = allcargo_pl_longq_r$year, Ratio = Quick_ratio)

# Create ggplot for Quick Ratio
rp5_allcargo <- ggplot(r5_allcargo_long, aes(x = Year, y = Ratio)) +
  geom_point(color = "red", size = 5) +
  geom_line(aes(group = 1), color = "blue", linewidth = 2) +
  
  labs(x = "Year", y = "Quick Ratio",
       title = "Quick Ratio Over the Years",
       subtitle = "allcargo Logistics Limited (2020 - 2024)",
       caption = "Created by Pavan") +
    geom_text(aes(label = round(Ratio, 2)), vjust = -1, color = "black")+  # Display rounded values
    scale_y_continuous(
    limits = c(0, 1.5),  # Set y-axis limits
    breaks = seq(0, 1.5, by = 0.5),  # Set y-axis breaks
    labels = seq(0, 1.5, by = 0.5)  # Label y-axis
    
  )

# Print the plot
print(rp5_allcargo)

Quick Ratio

Strengths:

  1. Good Cash Management: The company maintains sufficient cash reserves and liquid assets, ensuring a strong quick ratio.

  2. Efficient Receivables Collection: Timely collection of accounts receivable supports quick liquidity management.

Weaknesses:

  1. Dependence on Inventory: If most current assets are tied up in inventory rather than cash or receivables, the quick ratio may suffer.

  2. Delayed Payments: Delays in receiving payments from clients could reduce the quick ratio and affect short-term liquidity.

#--------------------------------------------
#6 Cash ratio
#Cash Ratio = (cash+short-term Marketable Investment) / current liabilities
allcargo_pl_longc_r<-data.frame(year = c(2020,2021,2022,2023,2024),
                                CashAndCash_Equi=c(48.38,41.06,76.71,82.4,19.63),
                                Curr_Invest=c(5.02,29.03,134.69,169.85,0),
                                tot_curr_liab=c(897.73,1223.54,1201.60,592.74,799.98))
#calculate cash and sh_t investment
allcargo_pl_longc_r$cash_and_sh_investment <- allcargo_pl_longc_r$CashAndCash_Equi+allcargo_pl_longc_r$Curr_Invest
#calculate cash ratio
cash_ratio <- (allcargo_pl_longc_r$cash_and_sh_investment / allcargo_pl_longc_r$tot_curr_liab)

# Create a dataframe for Cash Ratio
r6_allcargo_long<- data.frame(Year = allcargo_pl_longq_r$year, Ratio = cash_ratio)

# Create ggplot for Cash Ratio
rp6_allcargo <- ggplot(r6_allcargo_long, aes(x = Year, y = Ratio)) +
  geom_point(color = "red", size = 5) +
  geom_line(aes(group = 1), color = "blue", linewidth = 2) +
  
  labs(x = "Year", y = "Cash Ratio",
       title = "Cash Ratio Over the Years",
       subtitle = "allcargo Logistics Limited (2020 - 2024)",
       caption = "Created by Pavan") +
     geom_text(aes(label = round(Ratio, 2)), vjust = -1, color = "black")+  # Display rounded values
     scale_y_continuous(
    limits = c(0, 0.5),  # Set y-axis limits
    breaks = seq(0, 0.5, by = 0.5),  # Set y-axis breaks
    labels = seq(0, 0.5, by = 0.5)  # Label y-axis
     )

# Print the plot
print(rp6_allcargo)

Cash Ratio

Strengths:

  1. A healthy cash ratio indicates that Allcargo Logistics maintains a sufficient cash reserve to cover its immediate liabilities, ensuring short-term financial stability.

  2. Effective cash management practices may allow the company to respond quickly to unexpected financial challenges or market opportunities.

Weaknesses:

  1. If the cash ratio is excessively high, it may suggest that Allcargo is not efficiently utilizing its cash for investments or growth opportunities.

  2. A low cash ratio would indicate potential liquidity concerns, meaning the company may struggle to meet its obligations if any unforeseen expenses arise.

SOLVENCY RATIO Solvency ratios measure a company’s ability to meet its long-term financial obligations and ensure it remains financially stable in the future. These ratios are important for evaluating a company’s financial health and its capacity to sustain operations over time.

#Debt Ratios

#--------------------------------------------
#7 Debt-to-Asset ratio
#Define groups from the items
total_debt <- c("Lg_TM_Borrowing","Sh_TM_Borrowings")       
total_asset <- c("Tan_Asset","Intan_Asset","Cap_Work_In_Progress","Non_Curr_Invest","DeferredTaxAsset_Net","Lg_Tm_LoansAndAdvanc","Oth_Non_Curr_ Asset","Curr_Invest","Inventories","Trade_Receiva","CashAndCash_Equi","Sh_Tm_LoansAnd Advanc","Oth_Curr_Assets")

#Finding the sum of items in each group year wise
sum_total_debt = tapply(alcargo_bs_long$Amount[alcargo_bs_long$Item %in% total_debt], alcargo_bs_long$Year[alcargo_bs_long$Item %in% total_debt], sum)
sum_total_asset = tapply(alcargo_bs_long$Amount[alcargo_bs_long$Item %in% total_asset], alcargo_bs_long$Year[alcargo_bs_long$Item %in% total_asset], sum)

#Finding the ratio of sum in each group - yearwise
debt_asset_ratio <-  sum_total_debt / sum_total_asset

#creating dataframe
r7_ratio <- (data.frame(Year=names(debt_asset_ratio),
           Ratio=unname(debt_asset_ratio)))

r7_ratio$Year <- as.numeric(r7_ratio$Year)

rp7_allcargo <- ggplot(r7_ratio, aes(x = Year, y = Ratio)) +
  geom_point(color = "black", size = 6) +
  geom_line(color = "blue", size =2) +
  labs(
    x = "Year",
    y = "Debt-to-asset ratio",
    title = "Debt-to-asset ratio for the years")+
  geom_text(aes(label = round(Ratio,2)), vjust = -1, color = "black") +  # Display numbers above points
    scale_y_continuous(
    limits = c(0, 0.5),  # Set y-axis limits
    breaks = seq(0, 0.5, by =0.10), # Set the breaks on the y-axis
    labels = seq(0, 0.5,by =0.10))
    grid.arrange(rp7_allcargo)

Strengths Summary: 1.The company maintains a moderate debt-to-asset ratio (under 50%), suggesting a balanced mix of debt and equity financing.
- This structure affords greater financial flexibility and lowers the risk associated with over-leverage.
2.A downward trend in the ratio, as seen in 2023, indicates a move toward a more conservative and potentially more stable capital structure.

Weaknesses Summary:
1. Despite being moderate, the existing levels of debt impose fixed financial obligations that could become problematic in adverse economic conditions.
2. The ratio is sensitive to shifts in asset values, meaning that any drop in the asset base could disproportionately affect the company’s solvency.
3. Some variability in the ratio implies potential inconsistencies in long-term asset or debt management strategies.

#--------------------------------------------
#8 Debt-to-Capital ratio
#Define groups from the items
total_debt <- c("Lg_TM_Borrowing","Sh_TM_Borrowings")       
total_capital <- c("Lg_TM_Borrowing","Sh_TM_Borrowings","Eq_ShareCap","ReserveandSurplus")

#Finding the sum of items in each group year wise
sum_total_debt = tapply(alcargo_bs_long$Amount[alcargo_bs_long$Item %in% total_debt], alcargo_bs_long$Year[alcargo_bs_long$Item %in% total_debt], sum)
sum_total_capital = tapply(alcargo_bs_long$Amount[alcargo_bs_long$Item %in% total_capital], alcargo_bs_long$Year[alcargo_bs_long$Item %in% total_capital], sum)

#Finding the ratio of sum in each group - yearwise
debt_capital_ratio <-  sum_total_debt / sum_total_capital

#creating dataframe
r8_ratio <- data.frame(
  Year = names(debt_capital_ratio),
  Ratio = as.numeric(debt_capital_ratio))

r8_ratio$Year <- as.numeric(r8_ratio$Year)

rp8_allcargo <- ggplot(r8_ratio, aes(x = Year, y = Ratio)) +
  geom_point(color = "black", size = 6) +
  geom_line(color = "blue", size =2) +
  labs(
    x = "Year",
    y = "Debt-to-Capital ratio",
  title = "Debt-to-Capital ratio")+
  geom_text(aes(label = round(Ratio,2)), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
  limits = c(0, 1),  # Set y-axis limits
  breaks = seq(0, 1, by =0.10), # Set the breaks on the y-axis
  labels = seq(0, 1,by =0.10))
 grid.arrange(rp8_allcargo)

Debt-to-Capital Ratio

Strengths:
1.Balanced Capital Structure: With debt-to-equity ratios well below 1 in many periods, the company is not over-leveraged. Equity financing accounts for roughly 51–58% of total assets.
2.Improved Interest Coverage: Noticeably, after a low point in 2020, the firm’s ability to cover its interest payments improved markedly in 2022 and 2023, signaling enhanced operational capacity to service debt.

Weaknesses:
1.Even though the overall gearing remains moderate, the substantial reliance on current liabilities (which appear relatively high compared to current assets) poses refinancing or rollover risks if market conditions tighten.

#--------------------------------------------
#9 Debt-to-equity ratio
#Define groups from the items
total_debt <- c("Lg_TM_Borrowing","Sh_TM_Borrowings")  
total_sh_equity  <- c("Eq_ShareCap","Bonus_Equ_Sh_Cap","Revaluation_Reserv","ReserveandSurplus")      


#Finding the sum of items in each group year wise
sum_total_debt = tapply(alcargo_bs_long$Amount[alcargo_bs_long$Item %in% total_debt], alcargo_bs_long$Year[alcargo_bs_long$Item %in% total_debt], sum)
sum_total_sh_equity = tapply(alcargo_bs_long$Amount[alcargo_bs_long$Item %in% total_sh_equity], alcargo_bs_long$Year[alcargo_bs_long$Item %in% total_sh_equity], sum)

#Finding the ratio of sum in each group - yearwise
debt_equity_ratio <- sum_total_debt / sum_total_sh_equity

#creating dataframe
r9_ratio <- data.frame(
  Year = names(debt_equity_ratio),
  Ratio = as.numeric(debt_equity_ratio))

r9_ratio$Year <- as.numeric(r9_ratio$Year)

rp9_allcargo <- ggplot(r9_ratio, aes(x = Year, y = Ratio)) +
  geom_point(color = "black", size = 6) +
  geom_line(color = "blue", size =2) +
  labs(
    x = "Year",
    y = "Debt-to-equity ratio",
    title = "Debt-to-equity ratio")+
  geom_text(aes(label = round(Ratio,2)), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
  limits = c(0, 1),  # Set y-axis limits
  breaks = seq(0, 1, by =0.10), # Set the breaks on the y-axis
  labels = seq(0, 1,by =0.10))
  grid.arrange(rp9_allcargo)

Debt-to-Equity Ratio

Strengths:

  1. Balanced Capital Structure: Allcargo Logistics has maintained a moderate debt-to-equity ratio, reflecting a balanced use of debt and equity to finance its operations. This ensures financial stability and growth.

  2. Leverage for Expansion: The company has strategically used debt to finance acquisitions and expand its global footprint. As a result, it has enhanced market presence while maintaining manageable debt levels.

Weaknesses:

  1. Although Allcargo has maintained a reasonable debt-to-equity ratio, further reliance on debt for future expansions could lead to increased financial risk.

  2. Rising interest rates could lead to higher interest expenses on the company’s existing debt, reducing profitability and overall financial flexibility.

#--------------------------------------------
#10 Financial Leverage
#Define groups from the items
avg_total_asset <- c("Tan_Asset","Intan_Asset","Cap_Work_In_Progress","Non_Curr_Invest","DeferredTaxAsset_Net","Lg_Tm_LoansAndAdvanc","Oth_Non_Curr_ Asset","Curr_Invest","Inventories","Trade_Receiva","CashAndCash_Equi","Sh_Tm_LoansAnd Advanc","Oth_Curr_Assets")       
avg_total_equity <- c("Eq_ShareCap","ReserveandSurplus")

#Finding the sum of items in each group year wise
sum_avg_total_asset = tapply(alcargo_bs_long$Amount[alcargo_bs_long$Item %in% avg_total_asset], alcargo_bs_long$Year[alcargo_bs_long$Item %in% avg_total_asset], sum)
sum_avg_total_equity = tapply(alcargo_bs_long$Amount[alcargo_bs_long$Item %in% avg_total_equity], alcargo_bs_long$Year[alcargo_bs_long$Item %in% avg_total_equity], sum)

#Finding the ratio of sum in each group - yearwise#Finding the ratio of sum in each group - yearwisesum
financial_leverage <-  sum_avg_total_asset / sum_avg_total_equity

#creating dataframe
r10_ratio <- data.frame(
  Year = names(financial_leverage),
  Ratio = as.numeric(financial_leverage))

r10_ratio$Year <- as.numeric(r10_ratio$Year)

rp10_allcargo <- ggplot(r10_ratio, aes(x = Year, y = Ratio)) +
  geom_point(color = "black", size = 6) +
  geom_line(color = "blue", size =2) +
  labs(
    x = "Year",
    y = "financial_leverage",
    title = "Financial Leverage")+
  geom_text(aes(label = round(Ratio,2)), vjust = -1, color = "black") +  # Display numbers above points
  scale_y_continuous(
  limits = c(1, 2),  # Set y-axis limits
  breaks = seq(1, 2, by =0.20), # Set the breaks on the y-axis
  labels = seq(1, 2,by =0.20))
  grid.arrange(rp10_allcargo)

Financial Leverage Strengths:

  1. The financial leverage ratio remains below 2.5, indicating that the company is not excessively relying on debt to finance assets.

  2. A decreasing trend (from 2.43 in 2020 to 1.81 in 2023) suggests the company is improving its equity base, reducing leverage risks.

Weaknesses:

  1. A slight increase in 2024 (from 1.81 in 2023 to 1.97) may indicate the company is taking on additional liabilities.

  2. If leverage increases beyond 2.5, it could signal over-reliance on borrowed funds, raising the risk of financial distress.

Profitability Ratios Profitability ratios assess how well a company generates profit relative to its revenue, assets, or equity. These ratios are crucial for determining a company’s ability to make money and evaluating its overall financial success.

#OPERATING PROFIT MARGIN = OPERATING PROFIT/REVENUE FROM OPERATION)*100 
#11 OPERATING PROFIT = Total operating Revenue-(operating and direct expenses+Employee Benefit Expenses+depreciation+other operating cost)
allcargo_pl_long<-data.frame(year = c(2020,2021,2022,2023,2024),
                             Total_operating_revenue=c(1619.31, 1970.43, 3432.62, 2721.84, 1633.29),
                             Opr_and_dir_Exp=c(1184.83, 1534.15, 2876.27, 2310.44, 1368.54),
                             EmployeeBenefitExp=c(133.42, 127.74, 153.18, 156.15, 121.47),
                             DepAndAmortExp=c(115.05, 102.47, 90.11, 15.83, 19.15),
                             OtherExp=c(126.45, 126.45, 140.04, 93.92, 103.11))
#calculate operating profit 
allcargo_pl_long$operating_profit <- allcargo_pl_long$Total_operating_revenue-(allcargo_pl_long$Opr_and_dir_Exp
                                                                               +allcargo_pl_long$EmployeeBenefitExp
                                                                               +allcargo_pl_long$DepAndAmortExp
                                                                               +allcargo_pl_long$OtherExp)


#calculate operating profit margin
operating_pr_margin <- (allcargo_pl_long$operating_profit / allcargo_pl_long$Total_operating_revenue) * 100


# Create a dataframe for Opr pr margin Ratio
r11_allcargo_long<- data.frame(Year = allcargo_pl_longq_r$year, Ratio = operating_pr_margin)

# Create ggplot for Opr pr margin Ratio
rp11_allcargo <- ggplot(r11_allcargo_long, aes(x = Year, y = Ratio)) +
  geom_point(color = "red", size = 5) +
  geom_line(aes(group = 1), color = "blue", linewidth = 2) +
  
  labs(x = "Year", y = "OPERATING PROFIT MARGIN",
       title = "OPERATING PROFIT MARGIN Over the Years",
       subtitle = "allcargo Logistics Limited (2020 - 2024)",
       caption = "Created by Pavan") +
    geom_text(aes(label = round(Ratio, 2)), vjust = -1, color = "black") +  # Display rounded values
    scale_y_continuous(
    limits = c(0, 6),  # Set y-axis limits
    breaks = seq(0, 6, by = 1),  # Set y-axis breaks
    labels = seq(0, 6, by = 1)  # Label y-axis
    
  )

# Print the plot
print(rp11_allcargo)

Strengths: 1.Consistent Profitability: Operating profits remain positive throughout, and ROE shows that capital employed is generating respectable returns in some years exceeding average.
2.Operating Efficiency Improvements: The substantial improvement in operational efficiency improved considerably.

Weaknesses:
1.Margin Volatility: The fluctuation in operating profit margins indicates that earnings can be inconsistent, potentially tied to factors such as cost variability, temporary accounting adjustments (e.g., depreciation), or market-driven revenue pressures.
2.Earnings Stability Concerns: While profitability is evident, the apparent volatility in margins and periodic dips in ROE may signal vulnerabilities if cost pressures or revenue declines recur.

#----------------------------------
#Split item 1
bs1_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items=="Eq_ShareCap",])

ps1_vrl=ggplot(bs1_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Equity Share Capital",
       caption = "Created by Team Logistics",
       subtitle="Allvrl logistics limited (2020 - 2024)")+
  scale_y_continuous(
    limits = c(50,100),  # Set y-axis limits
    breaks = seq(50,100, by = 10),  # Set the breaks on the y-axis
    labels = seq(50,100, by = 10))  # Label the y-axis with values from 50 to 80
     grid.arrange(ps1_vrl)

#----------------------------------
#Split item 2
bs2_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items=="Pref_Share_Cap",])
#----------------------------------
#Split item 3
bs3_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items=="Revaluation_Reserv",])
#----------------------------------
#Split item 4
bs4_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items=="ReserveandSurplus",])

ps4_vrl=ggplot(bs4_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Reserve and Surplus",
       caption = "Created by Team Logistics",
       subtitle="vrl logistics limited (2020 - 2024)")+
  scale_y_continuous(
    limits = c(0, 1000),  # Set y-axis limits
    breaks = seq(0, 1000, by = 200),  # Set the breaks on the y-axis
    labels = seq(0, 1000, by = 200))  # Label the y-axis with values from 50 to 80
    grid.arrange(ps4_vrl)

#----------------------------------
#Split item 5
bs5_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items=="EmployeesStockOptions",])
#----------------------------------
#Split item 6
bs6_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items=="MoneyReceivedAgainst_ShWarrant",])
#----------------------------------
#Split item 7
bs7_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items=="Eq_Sh_ApplicationMoney",])
#---------------------------------
#Split item 8
bs8_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items=="Hybrid_Debt_OtherSecuritie",])
#----------------------------------------

#Split item 9
bs9_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items == "Sh_Cap_Suspense",])
#----------------------------------------
#Split item 10
bs10_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items == "Lg_TM_Borrowing",])

ps10_vrl=ggplot(bs10_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Long Term Borrowings",
       subtitle="vrl logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(0, 500),  # Set y-axis limits
    breaks = seq(0, 500, by = 100),  # Set the breaks on the y-axis
    labels = seq(0, 500, by = 100))
   grid.arrange(ps10_vrl)

#-----------------------------------
#Split item 11
bs11_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items == "Deferred_Tax_Liabilities_Net",])

ps11_vrl=ggplot(bs11_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Intangible Assets Under Developments",
       caption = "Created by Team Logistics",
       subtitle="vrl Logistics limited (2020 - 2024)")+
  scale_y_continuous(
    limits = c(0, 100),  # Set y-axis limits
    breaks = seq(0, 100, by = 20),  # Set the breaks on the y-axis
    labels = seq(0, 100, by = 20))  # Label the y-axis with values from 50 to 80
     grid.arrange(ps11_vrl)

#-----------------------------------

#Split item 12
bs12_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items == "Oth_Lg_Tm_Liab",])

ps12_vrl=ggplot(bs12_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Other Long Term Liabilities",
       subtitle="vrl logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(100, 1000),  # Set y-axis limits
    breaks = seq(100, 1000, by =200), # Set the breaks on the y-axis
    labels = seq(100, 1000,by =200))
     grid.arrange(ps12_vrl)

#-----------------------------------

#Split item 13
bs13_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items == "Lg Tm Provisions",])
ps13_vrl=ggplot(bs13_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Short Term Borrowings",
       subtitle="vrl logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(0, 50),  # Set y-axis limits
    breaks = seq(0,50, by =10), # Set the breaks on the y-axis
    labels = seq(0,50,by =10))
   grid.arrange(ps13_vrl)

#-----------------------------------

#Split item 14
bs14_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items == "Sh_TM_Borrowings",])

ps14_vrl=ggplot(bs14_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Short Term Borrowings",
       subtitle="vrl logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(0, 100),  # Set y-axis limits
    breaks = seq(0,100, by =20), # Set the breaks on the y-axis
    labels = seq(0,100,by =20))
    grid.arrange(ps14_vrl)

#-----------------------------------

#Split item 15
bs15_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items == "Trade_Payables",])

ps15_vrl=ggplot(bs15_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Trade Payables",
       subtitle="vrl logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(0, 25),  # Set y-axis limits
    breaks = seq(0, 25, by =5), # Set the breaks on the y-axis
    labels = seq(0, 25,by =5))
    grid.arrange(ps15_vrl)

#---------------------------------
#Split item 16
bs16_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items=="Oth_CurR_Liab",])

ps16_vrl=ggplot(bs16_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Other Current Liabilities",
       caption = "Created by Team Logistics",
       subtitle="vrl Logistics limited (2020 - 2024)")+
  scale_y_continuous(
    limits = c(100, 500),  # Set y-axis limits
    breaks = seq(100, 500, by = 100),  # Set the breaks on the y-axis
    labels = seq(100, 500, by = 100))  # Label the y-axis with values from 50 to 80
   grid.arrange(ps16_vrl)

#----------------------------------------
#Split item 17
bs17_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items == "Sh_Tm_Provi",])

ps17_vrl=ggplot(bs17_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Other Current Liabilities",
       caption = "Created by Team Logistics",
       subtitle="vrl Logistics limited (2020 - 2024)")+
  scale_y_continuous(
    limits = c(0, 20),  # Set y-axis limits
    breaks = seq(0, 20, by = 2),  # Set the breaks on the y-axis
    labels = seq(0, 20, by = 2))  # Label the y-axis with values from 50 to 80
   grid.arrange(ps17_vrl)

#-----------------------------------
#Split item 18
bs18_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items == "Tan_Asset",])

ps18_vrl=ggplot(bs18_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Tangible Assets",
       subtitle="vrl Logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(600, 2000),  # Set y-axis limits
    breaks = seq(600, 2000, by = 200),  # Set the breaks on the y-axis
    labels = seq(600, 2000, by = 200))  
     grid.arrange(ps18_vrl)

#-----------------------------------
#Split item 19
bs19_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items == "Intan_Asset",])

ps19_vrl=ggplot(bs19_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Intangible Assets",
       subtitle="vrl Logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(0, 1),  # Set y-axis limits
    breaks = seq(0, 1, by = 0.2),  # Set the breaks on the y-axis
    labels = seq(0, 1, by = 0.2))  
    grid.arrange(ps19_vrl)

#-----------------------------------
#Split item 20
bs20_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items == "Cap_Work_In_Progress",])

ps20_vrl=ggplot(bs20_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Capital Work-In-Progress",
       subtitle="vrl Logistics limited(2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(0, 50),  # Set y-axis limits
    breaks = seq(0, 50, by = 10),  # Set the breaks on the y-axis
    labels = seq(0, 50, by = 10))
     grid.arrange(ps20_vrl)

#---------------------------------
#Split item 21
bs21_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items=="Intang_Asset_Under_Development",])
#----------------------------------------
#Split item 22
bs22_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items == "Oth_Asset",])

ps22_vrl=ggplot(bs22_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Fixed Assets",
       subtitle="vrl Logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(0, 10),  # Set y-axis limits
    breaks = seq(0, 10, by = 1),  # Set the breaks on the y-axis
    labels = seq(0, 10, by = 1)) 
    grid.arrange(ps22_vrl)

#-----------------------------------
#Split item 23
bs23_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items == "FD_Asset",])

ps23_vrl=ggplot(bs23_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Fixed Assets",
       subtitle="Allvrl Logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(900, 2000),  # Set y-axis limits
    breaks = seq(900, 2000, by = 100),  # Set the breaks on the y-axis
    labels = seq(900, 2000, by = 100))  
     grid.arrange(ps23_vrl)

#-----------------------------------
#Split item 24
bs24_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items == "Non_Curr_Invest",])

ps24_vrl=ggplot(bs24_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in 00's",
       title="Non-Current Investments",
       subtitle="Allvrl Logistics limited(2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(0, 1),  # Set y-axis limits
    breaks = seq(0, 1, by = 0.2),  # Set the breaks on the y-axis
    labels = seq(0, 1, by = 0.2))  
    grid.arrange(ps24_vrl)

#-----------------------------------
#Split item 25
bs25_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items == "DeferredTaxAsset_Net",])
#-----------------------------------
#Split item 26
bs26_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items == "Lg_Tm_LoansAndAdvanc",])
#-----------------------------------
#Split item 27
bs27_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items == "Oth_Non_Curr_ Asset",])

ps27_vrl=ggplot(bs27_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Other Non CUrrent Asset",
       subtitle=" Allvrl Logistics limited(2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(0, 100),  # Set y-axis limits
    breaks = seq(0, 100, by = 10),  # Set the breaks on the y-axis
    labels = seq(0, 100, by = 10))
    grid.arrange(ps27_vrl)

#-----------------------------------
#Split item 28
bs28_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items == "Curr_Invest",])

ps28_vrl=ggplot(bs28_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Current Investment",
       subtitle=" Allvrl Logistics limited(2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(0, 20),  # Set y-axis limits
    breaks = seq(0, 20, by = 5),  # Set the breaks on the y-axis
    labels = seq(0, 20, by = 5))
     grid.arrange(ps28_vrl)

#-----------------------------------
#Split item 29
bs29_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items == "Inventories",])

ps29_vrl=ggplot(bs29_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Inventories",
       subtitle=" Allvrl Logistics limited(2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(20, 100),  # Set y-axis limits
    breaks = seq(20, 100, by = 10),  # Set the breaks on the y-axis
    labels = seq(20, 100, by = 10))
    grid.arrange(ps29_vrl)

#---------------------------------------
#Split item 30

bs30_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items == "Trade_Receiva",])

ps30_vrl=ggplot(bs30_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Trade Receivables",
       subtitle="vrl logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(50, 100),  # Set y-axis limits
    breaks = seq(50,100, by = 10),  # Set the breaks on the y-axis
    labels = seq(50,100, by = 10))  
    grid.arrange(ps30_vrl)

#---------------------------------------
#Split item 31

bs31_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items == "CashAndCash_Equi",])

ps31_vrl=ggplot(bs31_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Cash And Cash Equivalents",
       subtitle="vrl logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(10, 100),  # Set y-axis limits
    breaks = seq(10, 100, by = 10),  # Set the breaks on the y-axis
    labels = seq(10,100, by = 10))  
    grid.arrange(ps31_vrl)

#---------------------------------------
#Split item 32

bs32_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items == "Oth_Curr_Assets",])

ps32_vrl=ggplot(bs32_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Other Current Assets",
       subtitle="vrl logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(40, 80),  # Set y-axis limits
    breaks = seq(40, 80, by = 10),  # Set the breaks on the y-axis
    labels = seq(40,80, by = 10))  
    grid.arrange(ps32_vrl)

#----------------------------------------
#Split item 33

bs33_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items == "Contingent_Liab",])

ps33_vrl=ggplot(bs33_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Contingent Liabilities",
       subtitle="vrl logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(0, 500),  # Set y-axis limits
    breaks = seq(0, 500, by = 50),  # Set the breaks on the y-axis
    labels = seq(0,500, by = 50))  
    grid.arrange(ps33_vrl)

#----------------------------------------
#Split item 34

bs34_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items == "Raw_Materia",])
#----------------------------------------
#Split item 35
bs35_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items == "Stores_SparesAndLoose_Tools",])
#----------------------------------------
#Split item 36
bs36_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items == "Trade_Other_Goods",])
#----------------------------------------
#Split item 37
bs37_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items == "Capi_Goods",])
#----------------------------------------
#Split item 38
bs38_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items == "Expendi_In_Foreign_Currency",])

ps38_vrl=ggplot(bs38_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Expenditure In Foreign Currency",
       subtitle="vrl logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(0, 10),  # Set y-axis limits
    breaks = seq(0, 10, by = 1),  # Set the breaks on the y-axis
    labels = seq(0,10, by = 1))  
    grid.arrange(ps38_vrl)

#----------------------------------------

#Split item 39
bs39_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items == "Bonus_Equ_Sh_Cap",])

ps39_vrl=ggplot(bs39_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Bonus equity Share Capital",
       subtitle="vrl logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(60, 70),  # Set y-axis limits
    breaks = seq(60, 70, by = 1),  # Set the breaks on the y-axis
    labels = seq(60, 70, by = 1))  
    grid.arrange(ps39_vrl)    

#--------------------------------------
#Split item 40
bs40_vrl=as.data.frame(vrl_bs_long[vrl_bs_long$Items=="Non_Curr_Invest_Unquoted_Book_Value",])

ps40_vrl=ggplot(bs40_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Non Current Investment Unquoted Book Value",
       caption = "Created by Team Logistics",
       subtitle="vrl logistics limited (2020 - 2024)")+
  scale_y_continuous(
    limits = c(0, 1),  # Set y-axis limits
    breaks = seq(0, 1, by = 0.2),  # Set the breaks on the y-axis
    labels = seq(0, 1, by = 0.2))  # Label the y-axis with values from 0 to 200
    grid.arrange(ps40_vrl)

Statement Profit&Loss
 As Balance Sheet P&L statement is also cleaned and reshaped to do the workings. The plots are the visual representation of the data over the years. P&L statement mainly shows the profitability of the organization and is greatly emphasized in report created by us. It directly affects various ratios.  
 
#---------------------------------
#Split item 1
b1_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS=="RevfromOpr",])

p1_vrl=ggplot(b1_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Revenue From Operations",
       caption = "Created by Team Logistics",
       subtitle="VRL Logistics limited (2020 - 2024)")+
  scale_y_continuous(
    limits = c(1000, 3000),  # Set y-axis limits
    breaks = seq(1000, 3000, by = 1000),  # Set the breaks on the y-axis
    labels = seq(1000, 3000, by = 1000))  # Label the y-axis with values from 1000 to 3000
grid.arrange(p1_vrl)

#----------------------------------------
#Split item 2
b2_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS == "ExciseServiceTax",])
#-----------------------------------
#Split item 3
b3_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS == "revfromopr_net",])

p3_vrl=ggplot(b3_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Revenue From Operations (NET)",
       subtitle="vrl logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(1000, 3000),  # Set y-axis limits
    breaks = seq(1000, 3000, by = 1000),  # Set the breaks on the y-axis
    labels = seq(1000, 3000, by = 1000))
grid.arrange(p3_vrl)

#-----------------------------------
#Split item 4
b4_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS == "otherOprRev",])

p4_vrl=ggplot(b4_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Other Operating Revenues",
       subtitle="VRL logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(10, 25),  # Set y-axis limits
    breaks = seq(10,25, by =5), # Set the breaks on the y-axis
    labels = seq(10,25,by =5))
grid.arrange(p4_vrl)

#-----------------------------------
#Calculation of Total Operating Revenue using user-defined function

vrl_pl_longT1=vrl_pl_long[vrl_pl_long$ITEMS %in% c("revfromopr_net","otherOprRev"),]


by(vrl_pl_longT1$Amount,
   vrl_pl_longT1$Year, sum)
## vrl_pl_longT1$Year: 2020
## [1] 2118.54
## ------------------------------------------------------------ 
## vrl_pl_longT1$Year: 2021
## [1] 1762.92
## ------------------------------------------------------------ 
## vrl_pl_longT1$Year: 2022
## [1] 2393.65
## ------------------------------------------------------------ 
## vrl_pl_longT1$Year: 2023
## [1] 2648.52
## ------------------------------------------------------------ 
## vrl_pl_longT1$Year: 2024
## [1] 2888.62
result=as.list(by(vrl_pl_longT1$Amount,
                  vrl_pl_longT1$Year, sum))
res1=unlist(result)
Total_operating_revenue=data.frame(Year=names(res1),
                                   Total=unname(res1))


pT1_vrl=ggplot(Total_operating_revenue,aes(x=Year,y=Total))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Total, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Total Operating Revenue",
       subtitle="VRL logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(1000,3000),  # Set y-axis limits
    breaks = seq(1000,3000, by =1000), # Set the breaks on the y-axis
    labels = seq(1000,3000,by =1000))
grid.arrange(pT1_vrl)

#-----------------------------------
#Split item 5
b5_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS == "otherInc",])
#-----------------------------------
#Calculation of Total Income
vrl_pl_longT2=vrl_pl_long[vrl_pl_long$ITEMS %in% c("revfromopr_net","otherOprRev","otherInc"),]

by(vrl_pl_longT2$Amount,
   vrl_pl_longT2$Year, sum)
## vrl_pl_longT2$Year: 2020
## [1] 2128.86
## ------------------------------------------------------------ 
## vrl_pl_longT2$Year: 2021
## [1] 1775.78
## ------------------------------------------------------------ 
## vrl_pl_longT2$Year: 2022
## [1] 2410.46
## ------------------------------------------------------------ 
## vrl_pl_longT2$Year: 2023
## [1] 2662.86
## ------------------------------------------------------------ 
## vrl_pl_longT2$Year: 2024
## [1] 2909.72
result=as.list(by(vrl_pl_longT2$Amount,
                  vrl_pl_longT2$Year, sum))
res2=unlist(result)
Total_revenue=data.frame(Year=names(res2),
                         Total=unname(res2))


pT2_vrl=ggplot(Total_revenue,aes(x=Year,y=Total))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Total, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Total Revenue",
       subtitle="VRL logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(1000,3000),  # Set y-axis limits
    breaks = seq(1000,3000, by =1000), # Set the breaks on the y-axis
    labels = seq(1000,3000,by =1000))
grid.arrange(pT2_vrl)

#-----------------------------------------------
#Split item 6
b6_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS=="CostOfMat_Consumed",])
#----------------------------------------
#Split item 7
b7_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS=="CostOfPowerPurchased",])
#-----------------------------------
#Split item 8
b8_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS=="PurchaseOfStock_In_Trade",])
#-----------------------------------
#Split item 9
b9_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS=="CostOfFuel",])
#-----------------------------------
#Split item 10
b10_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS == "Opr_and_dir_Exp",])

p10_vrl=ggplot(b10_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Operating and direct expenses",
       subtitle="VRL logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(1000, 2000),  # Set y-axis limits
    breaks = seq(1000,2000, by =100), # Set the breaks on the y-axis
    labels = seq(1000,2000,by =100))
grid.arrange(p10_vrl)

#-----------------------------------
#Split item 11
b11_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS=="ChangesInInven",])
#-----------------------------------
#Split item 12
b12_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS == "EmployeeBenefitExp",])

p12_vrl=ggplot(b12_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Employee Benefit Expenses",
       subtitle="VRL logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(300, 500),  # Set y-axis limits
    breaks = seq(300,500, by =10), # Set the breaks on the y-axis
    labels = seq(300,500,by =10))
grid.arrange(p12_vrl)

#-----------------------------------
#Split item 13
b13_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS == "FinCosts",])

p13_vrl=ggplot(b13_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Financial Costs",
       subtitle="VRL logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(0, 100),  # Set y-axis limits
    breaks = seq(10,100, by =10), # Set the breaks on the y-axis
    labels = seq(10,100,by =10))
grid.arrange(p13_vrl)

#-----------------------------------
#Split item 14
b14_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS=="ProvisionsandContingencies",])
#-----------------------------------
#Split item 15
b15_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS == "DepAndAmortExp",])

p15_vrl=ggplot(b15_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Depreciation And Amortisation Expenses",
       subtitle="VRL logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(150, 250),  # Set y-axis limits
    breaks = seq(150,250, by =10), # Set the breaks on the y-axis
    labels = seq(150,250, by =10))
grid.arrange(p15_vrl)

#-----------------------------------
#Split item 16
b16_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS == "OtherExp",])

p16_vrl=ggplot(b16_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Other Expenses",
       subtitle="VRL logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(10, 50),  # Set y-axis limits
    breaks = seq(10,50, by =10), # Set the breaks on the y-axis
    labels = seq(10,50,by =10))
grid.arrange(p16_vrl)

#-----------------------------------
#Split item 17
b17_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS=="InterUnit_Segment_DivisionTransfer",])
#-----------------------------------
#Split item 18
b18_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS=="AmountsTransferToCapiAcc",])
#-----------------------------------
#Split item 19
b19_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS=="Transferto_FromInvestment_FixedAssets_Others",])
#-----------------------------------
#Calculation of Total Expenses
vrl_pl_longT3=vrl_pl_long[vrl_pl_long$ITEMS %in% c("Opr_and_dir_Exp","EmployeeBenefitExp","FinCosts","DepAndAmortExp","OtherExp"),]

by(vrl_pl_longT3$Amount,
   vrl_pl_longT3$Year, sum)
## vrl_pl_longT3$Year: 2020
## [1] 2024.53
## ------------------------------------------------------------ 
## vrl_pl_longT3$Year: 2021
## [1] 1712.05
## ------------------------------------------------------------ 
## vrl_pl_longT3$Year: 2022
## [1] 2200.57
## ------------------------------------------------------------ 
## vrl_pl_longT3$Year: 2023
## [1] 2460.35
## ------------------------------------------------------------ 
## vrl_pl_longT3$Year: 2024
## [1] 2789.19
result=as.list(by(vrl_pl_longT3$Amount,
                  vrl_pl_longT3$Year, sum))
res3=unlist(result)
Total_expenses=data.frame(Year=names(res3),
                          Total=unname(res3))


pT3_vrl=ggplot(Total_expenses,aes(x=Year,y=Total))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Total, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Total Expenses",
       subtitle="VRL logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(1000,3000),  # Set y-axis limits
    breaks = seq(1000,3000, by =1000), # Set the breaks on the y-axis
    labels = seq(1000,3000,by =1000))
grid.arrange(pT3_vrl)

#-----------------------------------
#Split item 20
b20_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS == "PLBeforeExceptional_ExtraOrdinaryItemsAndTax",])

p20_vrl=ggplot(b20_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Profit/Loss Before Exceptional, ExtraOrdinary Items And Tax",
       subtitle="VRL logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(50, 250),  # Set y-axis limits
    breaks = seq(50,250, by =50), # Set the breaks on the y-axis
    labels = seq(50,250,by =50))
grid.arrange(p20_vrl)

#-----------------------------------
#Split item 21
b21_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS == "ExceptionalItems",])
#-----------------------------------
#Calculation of Profit/loss before tax
vrl_pl_longT4=vrl_pl_long[vrl_pl_long$ITEMS %in% c("PLBeforeExceptional_ExtraOrdinaryItemsAndTax","ExceptionalItems"),]


by(vrl_pl_longT4$Amount,
   vrl_pl_longT4$Year, sum)
## vrl_pl_longT4$Year: 2020
## [1] 104.32
## ------------------------------------------------------------ 
## vrl_pl_longT4$Year: 2021
## [1] 63.74
## ------------------------------------------------------------ 
## vrl_pl_longT4$Year: 2022
## [1] 209.89
## ------------------------------------------------------------ 
## vrl_pl_longT4$Year: 2023
## [1] 202.52
## ------------------------------------------------------------ 
## vrl_pl_longT4$Year: 2024
## [1] 121
result=as.list(by(vrl_pl_longT4$Amount,
                  vrl_pl_longT4$Year, sum))
res4=unlist(result)
Profit_loss_before_tax=data.frame(Year=names(res4),
                                  Total=unname(res4))


pT4_vrl=ggplot(Profit_loss_before_tax,aes(x=Year,y=Total))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Total, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Profit/Loss Before Tax",
       subtitle="VRL logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(50,250),  # Set y-axis limits
    breaks = seq(50,250, by =50), # Set the breaks on the y-axis
    labels = seq(50,250,by =50))
grid.arrange(pT4_vrl)

#-----------------------------------
#Split item 22
b22_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS == "CurrentTax",])

p22_vrl=ggplot(b22_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Current Tax",
       subtitle="VRL logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(0, 60),  # Set y-axis limits
    breaks = seq(0,60, by =10), # Set the breaks on the y-axis
    labels = seq(0,60,by =10))
grid.arrange(p22_vrl)

#-----------------------------------
#Split item 23
b23_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS=="MAT_CreditEntitlement",])
#-----------------------------------
#Split item 24
b24_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS == "DeferredTax",])

p24_vrl=ggplot(b24_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Deferred Tax",
       subtitle="VRL logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(-20, 50),  # Set y-axis limits
    breaks = seq(-20,50, by =10), # Set the breaks on the y-axis
    labels = seq(-20,50,by =10))
grid.arrange(p24_vrl)

#-----------------------------------
#Split item 25
b25_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS=="TaxForEarlierYears",])

p25_vrl=ggplot(b25_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Tax For Earlier Years",
       subtitle="VRL logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(-5, 5),  # Set y-axis limits
    breaks = seq(-5,5, by =1), # Set the breaks on the y-axis
    labels = seq(-5,5,by =1))
grid.arrange(p25_vrl)

#-----------------------------------
#Calculation for Total Tax Expenses
vrl_pl_longT5=vrl_pl_long[vrl_pl_long$ITEMS %in% c("CurrentTax","DeferredTax","TaxForEarlierYears"),]


by(vrl_pl_longT5$Amount,
   vrl_pl_longT5$Year, sum)
## vrl_pl_longT5$Year: 2020
## [1] 14.2
## ------------------------------------------------------------ 
## vrl_pl_longT5$Year: 2021
## [1] 18.67
## ------------------------------------------------------------ 
## vrl_pl_longT5$Year: 2022
## [1] 49.78
## ------------------------------------------------------------ 
## vrl_pl_longT5$Year: 2023
## [1] 36.38
## ------------------------------------------------------------ 
## vrl_pl_longT5$Year: 2024
## [1] 31.93
result=as.list(by(vrl_pl_longT5$Amount,
                  vrl_pl_longT5$Year, sum))
res5=unlist(result)
Total_Tax_Expenses=data.frame(Year=names(res5),
                              Total=unname(res5))


pT5_vrl=ggplot(Total_Tax_Expenses,aes(x=Year,y=Total))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Total, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Total Tax Expenses",
       subtitle="VRL logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(0,50),  # Set y-axis limits
    breaks = seq(0,50, by =10), # Set the breaks on the y-axis
    labels = seq(0,50,by =10))
grid.arrange(pT5_vrl)

#-----------------------------------
#Split item 26
b26_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS == "PL_AfterTaxAndBeforeExtraOrdinaryItems",])

p26_vrl=ggplot(b26_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Profit/Loss After Tax And Before ExtraOrdinary Items",
       subtitle="VRL logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(0, 200),  # Set y-axis limits
    breaks = seq(0,200, by =50), # Set the breaks on the y-axis
    labels = seq(0,200,by =50))
grid.arrange(p26_vrl)

#-----------------------------------
#Split item 27
b27_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS == "PL_FromContinuingOperations",])

p27_vrl=ggplot(b27_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Profit/Loss From Continuing Operations",
       subtitle="VRL logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(0, 200),  # Set y-axis limits
    breaks = seq(0,200, by =50), # Set the breaks on the y-axis
    labels = seq(0,200,by =50))
grid.arrange(p27_vrl)

#-----------------------------------
#Split item 28
b28_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS=="PL_FromDiscontinuingOperations",])
#-----------------------------------
#Split item 29
b29_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS=="TotalTaxExpensesDiscontinuingOperations",])
#-----------------------------------
#Split item 30
b30_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS=="NetProfitLoss_FromDiscontinuingOperations",])
#-----------------------------------------------
#Calculation for Profit/loss for the period
vrl_pl_longT6=vrl_pl_long[vrl_pl_long$ITEMS %in% c("PL_AfterTaxAndBeforeExtraOrdinaryItems","NetProfitLoss_FromDiscontinuingOperations"),]


by(vrl_pl_longT6$Amount,
   vrl_pl_longT6$Year, sum)
## vrl_pl_longT6$Year: 2020
## [1] 90.11
## ------------------------------------------------------------ 
## vrl_pl_longT6$Year: 2021
## [1] 45.07
## ------------------------------------------------------------ 
## vrl_pl_longT6$Year: 2022
## [1] 160.11
## ------------------------------------------------------------ 
## vrl_pl_longT6$Year: 2023
## [1] 323.2
## ------------------------------------------------------------ 
## vrl_pl_longT6$Year: 2024
## [1] 88.85
result=as.list(by(vrl_pl_longT6$Amount,
                  vrl_pl_longT6$Year, sum))
res6=unlist(result)
Profit_Loss_For_The_Period=data.frame(Year=names(res6),
                                      Total=unname(res6))


pT6_vrl=ggplot(Profit_Loss_For_The_Period,aes(x=Year,y=Total))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Total, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Profit/loss for the period",
       subtitle="VRL logistics limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(0,400),  # Set y-axis limits
    breaks = seq(0,400, by =100), # Set the breaks on the y-axis
    labels = seq(0,400,by =100))
grid.arrange(pT6_vrl)

#-----------------------------------------------
#Split item 31
b31_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS == "BasicEPS",])

p31_vrl=ggplot(b31_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in cr's",
       title="Basic EPS (Rs.)",
       subtitle="VRL LOGISTICS limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(0, 50),  # Set y-axis limits
    breaks = seq(0, 50, by = 5),  # Set the breaks on the y-axis
    labels = seq(0, 50, by = 5))
grid.arrange(p31_vrl)

#-----------------------------------------------
#Split item 32
b32_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS == "DilutedEPS",])

p32_vrl=ggplot(b31_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in cr's",
       title="Diluted EPS EPS (Rs.)",
       subtitle="VRL LOGISTICS limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(0, 50),  # Set y-axis limits
    breaks = seq(0, 50, by = 5),  # Set the breaks on the y-axis
    labels = seq(0, 50, by = 5))
grid.arrange(p32_vrl)

#-----------------------------------
#Split item 33
b33_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS=="ImportedRawMaterials",])
#-----------------------------------
#Split item 34
b34_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS=="IndigenousRawMaterials",])
#-----------------------------------
#Split item 35
b35_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS=="ImportedStoresAndSpares",])
#-----------------------------------
#Split item 36
b36_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS=="IndigenousStoresAndSpares",])
#-----------------------------------
#Split item 37_
b37_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS == "EquityShareDividend",])

p37_vrl=ggplot(b37_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in cr's",
       title="Equity Share Dividend",
       subtitle="VRL LOGISTICS limited (2020 - 2024)",
       caption = "Created by Team Logistics")+
  scale_y_continuous(
    limits = c(0,200),  # Set y-axis limits
    breaks = seq(0,200, by = 100),  # Set the breaks on the y-axis
    labels = seq(0,200, by = 100))
grid.arrange(p37_vrl)

#-----------------------------------
#Split item 38
b38_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS == "TaxOnDividend",])
#-----------------------------------
#Split item 39
b39_vrl=as.data.frame(vrl_pl_long[vrl_pl_long$ITEMS=="EquityDividendRate",])

p39_vrl=ggplot(b39_vrl,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in cr's",
       title="Equity Dividend Rate (%)",
       caption = "Created by Team Logistics",
       subtitle="VRL LOGISTICS limited (2020 - 2024)")+
  scale_y_continuous(
    limits = c(0,100),  # Set y-axis limits
    breaks = seq(0,100, by = 10),  # Set the breaks on the y-axis
    labels = seq(0,100, by = 10))  # Label the y-axis with values from 50 to 80
grid.arrange(p39_vrl)
<>head> cash Flow Statement
     Data provided in cash flow statement is cleaned, reshaped and loaded into R. The plots represented under CSF shows the trend of changes in each and every variables over the years. Cash flow statement highly emphasizes the inflow and outflow of cash in the organization.
      
#Split item 1
c1_vrl_cfs=as.data.frame(vrl_cfs_long[vrl_cfs_long$items=="npbt",])

p1_vrl_cfs=ggplot(c1_vrl_cfs,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Net Profit Before Tax",
       caption = "Cleaned by Team",
       subtitle="Allcargo logistics limited (2020 - 2024)")+
  scale_y_continuous(
    limits = c(50, 300),  # Set y-axis limits
    breaks = seq(50, 300, by = 50),  # Set the breaks on the y-axis
    labels = seq(50, 300, by = 50)) 
grid.arrange(p1_vrl_cfs)

#----------------------------------------
#Split item 2
c2_vrl_cfs=as.data.frame(vrl_cfs_long[vrl_cfs_long$items == "NetCashFromOperActiv",])

p2_vrl_cfs=ggplot(c2_vrl_cfs,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Net Cash From Operating Activities",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Cleaned by Team")+
  scale_y_continuous(
    limits = c(200, 500),  # Set y-axis limits
    breaks = seq(200, 500, by = 100),  # Set the breaks on the y-axis
    labels = seq(200, 500, by = 100))
grid.arrange(p2_vrl_cfs)

#-----------------------------------
#Split item 3
c3_vrl_cfs=as.data.frame(vrl_cfs_long[vrl_cfs_long$items == "NetCashfromInvestingActiv",])

p3_vrl_cfs=ggplot(c3_vrl_cfs,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Net Cash(used in)/from",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Cleaned by Team")+
  scale_y_continuous(
    limits = c(-300, 0),  # Set y-axis limits
    breaks = seq(-300, 0, by =50), # Set the breaks on the y-axis
    labels = seq(-300, 0,by =50))
grid.arrange(p3_vrl_cfs)

#-----------------------------------
#Split item 4
c4_vrl_cfs=as.data.frame(vrl_cfs_long[vrl_cfs_long$items == "NetCashfromFinActiv",])

p4_vrl_cfs=ggplot(c4_vrl_cfs,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Net Cash(used in)/from Financing Activities",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Cleaned by Team")+
  scale_y_continuous(
    limits = c(-300, 0),  # Set y-axis limits
    breaks = seq(-300, 0, by =50), # Set the breaks on the y-axis
    labels = seq(-300, 0,by =50))
grid.arrange(p4_vrl_cfs)

#-----------------------------------
#Split item 5
c5_vrl_cfs=as.data.frame(vrl_cfs_long[vrl_cfs_long$items == "Netdec_inc_In_CashandCashEquiv",])

p5_vrl_cfs=ggplot(c5_vrl_cfs,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Net (decrease)/increase In Cash and Cash Equivalents",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Cleaned by Team")+
  scale_y_continuous(
    limits = c(-20, 20),  # Set y-axis limits
    breaks = seq(-20, 20, by =10), # Set the breaks on the y-axis
    labels = seq(-20, 20,by =10))
grid.arrange(p5_vrl_cfs)

#-----------------------------------
#Split item 6
c6_vrl_cfs=as.data.frame(vrl_cfs_long[vrl_cfs_long$items == "Op_Cash_CashEquiv",])

p6_vrl_cfs=ggplot(c6_vrl_cfs,aes(x=Year,y=Amount))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Amount, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y="Amount in Cr's",
       title="Opening Cash & Cash Equivalents",
       subtitle="Allcargo logistics limited (2020 - 2024)",
       caption = "Cleaned by Team")+
  scale_y_continuous(
    limits = c(0, 20),  # Set y-axis limits
    breaks = seq(0, 20, by =5), # Set the breaks on the y-axis
    labels = seq(0, 20,by =5))
grid.arrange(p6_vrl_cfs)

RATIOS CALCULATION #Activity ratio Activity ratios measure how effectively a company uses its assets and resources to operate and generate revenue. These ratios help businesses evaluate their efficiency in managing assets like inventory, receivables, and fixed assets. They act as indicators of how “busy” or “productive” the business is in using what it owns.

#Calculation of Trade receivable Turnover ratio
#Define groups from the items
num <-  c("revfromopr_net")  
den  <- c("Trade_Receiva")      

#Finding the sum of items in each group year wise
sum_num = tapply(vrl_pl_long$Amount[vrl_pl_long$ITEMS %in% num], vrl_pl_long$Year[vrl_pl_long$ITEMS %in% num], sum)
sum_den = tapply(vrl_bs_long$Amount[vrl_bs_long$Item %in% den], vrl_bs_long$Year[vrl_bs_long$Item %in% den], mean)

#Finding the ratio of sum in each group - year wise
trade_receivable_turnover_ratio <- sum_num / sum_den 

#creating dataframe
r1_ratio <- data.frame(
  Year = names(trade_receivable_turnover_ratio),
  Ratio = as.numeric(trade_receivable_turnover_ratio))

r1_ratio$Year <- as.numeric(r1_ratio$Year)

rp1_vrl <- ggplot(r1_ratio, aes(x = Year, y = Ratio)) +
      geom_point(color = "black", size = 6) +
      geom_line(color = "blue", size =2) +
      geom_text(aes(label = round(Ratio,2)), vjust = -1, color = "black") +  # Display numbers above points
      labs(
    x = "Year",
    y = "Trade Receivable Turnover Ratio",
    title = "Trade Receivable Turnover Ratio Over Years"
  ) +scale_y_continuous(
    limits = c(0, 50),  # Set y-axis limits
    breaks = seq(0, 50, by =10), # Set the breaks on the y-axis
    labels = seq(0, 50,by =10))
    grid.arrange(rp1_vrl)

grid.arrange(rp1_allcargo, rp1_vrl, ncol = 2)

# calculation of Fixed Turnover Ratio
#Define groups from the items
nr <-  c("revfromopr_net")  
dr  <- c("FD_Asset")   

#Finding the sum of items in each group year wise
sum_nr = tapply(vrl_pl_long$Amount[vrl_pl_long$ITEMS %in% nr], vrl_pl_long$Year[vrl_pl_long$ITEMS %in% nr], sum)
sum_dr = tapply(vrl_bs_long$Amount[vrl_bs_long$Item %in% dr], vrl_bs_long$Year[vrl_bs_long$Item %in% dr], mean)

#Finding the ratio of sum in each group - year wise
fixed_asset_turnover_ratio <- sum_nr / sum_dr 

#creating dataframe
r2 = data.frame(Year=names(fixed_asset_turnover_ratio),
                Ratio=unname(fixed_asset_turnover_ratio))

#plot for ratio

rp2_vrl=ggplot(r2,aes(x=Year,y=Ratio))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Ratio, group=1),
            col="blue",
            linewidth=2)+
  geom_text(aes(label = round(Ratio, 2)), vjust = -1, color = "black")+  # Rounds to 2 decimal places+  # Display numbers above points
  
  labs(x="Year",y="Fixed Turnover Ratio",
       title=" Fixed Turnover Ratio Over year",
       caption = "Created by Team Logistics",
       subtitle="vrl logistics limited (2020 - 2024)")+
  geom_text(aes(label = round(Ratio, 2)), vjust = -1, color = "black")+
  scale_y_continuous(
    limits = c(0, 3),  # Set y-axis limits
    breaks = seq(0, 3, by = 0.5),  # Set the breaks on the y-axis
    labels = seq(0, 3, by = 0.5))  # Label the y-axis with values from 100 to 500
     grid.arrange(rp2_vrl)

grid.arrange(rp2_allcargo, rp2_vrl, ncol=2)

#----------------------------------------
# Calculation of Total asset turnover
#Define groups from the items
nr1 <-  c("revfromopr_net")  
dr1  <- c("Tan_Asset","Intan_Asset","Cap_Work_In_Progress","Non_Curr_Invest","DeferredTaxAsset_Net","Lg_Tm_LoansAndAdvanc","Oth_Non_Curr_ Asset","Curr_Invest","Inventories","Trade_Receiva","CashAndCash_Equi","Sh_Tm_LoansAnd Advanc","Oth_Curr_Assets")      

#Finding the sum of items in each group year wise
sum_nr1 = tapply(vrl_pl_long$Amount[vrl_pl_long$ITEMS %in% nr1], vrl_pl_long$Year[vrl_pl_long$ITEMS %in% nr1], sum)
sum_dr1 = tapply(vrl_bs_long$Amount[vrl_bs_long$Item %in% dr1], vrl_bs_long$Year[vrl_bs_long$Item %in% dr1], sum)

#Finding the ratio of sum in each group - year wise#Finding the ratio of sum in each group - year wisesum
total_asset_turnover_ratio <- sum_nr1 / sum_dr1 

#creating dataframe
r3 = data.frame(Year=names(total_asset_turnover_ratio),
                Ratio=unname(total_asset_turnover_ratio))

rp3_vrl=ggplot(r3,aes(x=Year,y=Ratio))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Ratio, group=1),
            col="blue",
            linewidth=2)+
   # Rounds to 2 decimal places+  # Display numbers above points
  
  labs(x="Year",y="Total asset turnover",
       title="Total asset turnover Over year",
       caption = "Created by Team Logistics",
       subtitle="vrl logistics limited (2020 - 2024)")+
  geom_text(aes(label = round(Ratio, 2)), vjust = -1, color = "black")+ # Rounds to 2 decimal places+  # Display numbers above points
  
  scale_y_continuous(
    limits = c(0, 3),  # Set y-axis limits
    breaks = seq(0, 3, by = 0.5),  # Set the breaks on the y-axis
    labels = seq(0, 3, by = 0.5))  # Label the y-axis with values from 100 to 500
    

 grid.arrange(rp3_vrl)

grid.arrange(rp3_allcargo, rp3_vrl, ncol = 2)

Liquidity ratio Liquidity ratios measure a company’s ability to meet its short-term financial obligations, like paying bills or repaying loans, using its liquid assets—those that can be quickly converted to cash. These ratios show how financially healthy and stable a business is in the short run.

#Calculating current ratio
#Define groups from the items
current_assets <- c("Curr_Invest","Inventories","Trade_Receiva","CashAndCash_Equi","Sh_Tm_LoansAnd Advanc","Oth_Curr_Assets")  
current_liabilities <- c("Sh_TM_Borrowings","Trade_Payables","Oth_CurR_Liab","Sh_Tm_Provi")      

#Finding the sum of items in each group year wise
sum_current_assets = tapply(vrl_bs_long$Amount[vrl_bs_long$Item %in% current_assets], vrl_bs_long$Year[vrl_bs_long$Item %in% current_assets], sum)
sum_current_liabilities = tapply(vrl_bs_long$Amount[vrl_bs_long$Item %in% current_liabilities], vrl_bs_long$Year[vrl_bs_long$Item %in% current_liabilities], sum)

#Finding the ratio of sum in each group - yearwise
current_ratio <- sum_current_assets / sum_current_liabilities

#creating dataframe
r4_ratio <- data.frame(
  Year = names(current_ratio),
  Ratio = as.numeric(current_ratio))

r4_ratio$Year <- as.numeric(r4_ratio$Year)
r4_ratio <- data.frame(
  Year = names(current_ratio),
  Ratio = as.numeric(current_ratio))

r4_ratio$Year <- as.numeric(r4_ratio$Year)

r4 = data.frame(Year=names(current_ratio),
                Ratio=unname(current_ratio))

rp4_vrl=ggplot(r4,aes(x=Year,y=Ratio))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Ratio, group=1),
            col="blue",
            linewidth=2)+
   labs(x="Year",y="current ratio",
       title="current ratio Over year",
       caption = "Created by Team Logistics",
       subtitle="vrl logistics limited (2020 - 2024)")+
  geom_text(aes(label = round(Ratio, 2)), vjust = -1, color = "black")+  # Rounds to 2 decimal places+  # Display numbers above points
  scale_y_continuous(
    limits = c(0, 3),  # Set y-axis limits
    breaks = seq(0, 3, by = 0.5),  # Set the breaks on the y-axis
    labels = seq(0, 3, by = 0.5))  # Label the y-axis with values from 100 to 500

 grid.arrange(rp4_vrl)

grid.arrange(rp4_allcargo, rp4_vrl, ncol = 2)

#Calculation of Quick Ratio== (cash+short-term Marketable Investment+ receivables) / current liabilities
vrl_pl_longq_r<-data.frame(year = c(2020,2021,2022,2023,2024),
                           CashAndCash_Equi=c(13.41,18.45,14.49,75.24,18.95),
                           Curr_Invest=c(0,0,0,15.02,0),
                           Trade_Receiva=c(85.63,63.94,67.26,81.69,88.49),
                           tot_curr_liab=c(355.45,342.87,463.48,609.73,881.72))

#calculate cash and sh_t investment
vrl_pl_longq_r$cash_and_sh_invest_rec <- vrl_pl_longq_r$CashAndCash_Equi+vrl_pl_longq_r$Curr_Invest+vrl_pl_longq_r$Trade_Receiva


#calculate cash ratio
Quick_ratio <-(vrl_pl_longq_r$cash_and_sh_invest_rec  / vrl_pl_longq_r$tot_curr_liab)

# Create a dataframe for Quick Ratio
r5_vrl_long<- data.frame(Year = vrl_pl_longq_r$year, Ratio = Quick_ratio)

# Create ggplot for Quick Ratio
rp5_vrl <- ggplot(r5_vrl_long, aes(x = Year, y = Ratio)) +
  geom_point(color = "red", size = 5) +
  geom_line(aes(group = 1), color = "blue", linewidth = 2) +
  labs(x = "Year", y = "Quick Ratio",
       title = "Quick Ratio Over the Years",
       subtitle = "VRL Logistics Limited (2020 - 2024)",
       caption = "Created by Team Logistics") +
  geom_text(aes(label = round(Ratio, 2)), vjust = -1, color = "black") +  # Display rounded values
  scale_y_continuous(
    limits = c(0, 1),  # Set y-axis limits
    breaks = seq(0, 1, by = 0.2),  # Set y-axis breaks
    labels = seq(0, 1, by = 0.2))

# Print the plot

 grid.arrange(rp5_vrl)

grid.arrange(rp5_allcargo, rp5_vrl, ncol = 2)

#----------------------------------------


#Calculation of Quick Ratio== (cash+short-term Marketable Investment+ receivables) / current liabilities
vrl_pl_longq_r<-data.frame(year = c(2020,2021,2022,2023,2024),
                           CashAndCash_Equi=c(13.41,18.45,14.49,75.24,18.95),
                           Curr_Invest=c(0,0,0,15.02,0),
                           Trade_Receiva=c(85.63,63.94,67.26,81.69,88.49),
                           tot_curr_liab=c(355.45,342.87,463.48,609.73,881.72))

#calculate cash and sh_t investment
vrl_pl_longq_r$cash_and_sh_invest_rec <- vrl_pl_longq_r$CashAndCash_Equi+vrl_pl_longq_r$Curr_Invest+vrl_pl_longq_r$Trade_Receiva


#calculate cash ratio
Quick_ratio <-(vrl_pl_longq_r$cash_and_sh_invest_rec  / vrl_pl_longq_r$tot_curr_liab)

# Create a dataframe for Quick Ratio
r6_vrl_long<- data.frame(Year = vrl_pl_longq_r$year, Ratio = Quick_ratio)

# Create ggplot for Quick Ratio
rp6_vrl <- ggplot(r6_vrl_long, aes(x = Year, y = Ratio)) +
  geom_point(color = "red", size = 5) +
  geom_line(aes(group = 1), color = "blue", linewidth = 2) +
  labs(x = "Year", y = "Cash Ratio",
       title = "Cash Ratio Over the Years",
       subtitle = "VRL Logistics Limited (2020 - 2024)",
       caption = "Created by Team Logistics") +
  geom_text(aes(label = round(Ratio, 2)), vjust = -1, color = "black") +  # Display rounded values
  scale_y_continuous(
    limits = c(0, 1),  # Set y-axis limits
    breaks = seq(0, 1, by = 0.2),  # Set y-axis breaks
    labels = seq(0, 1, by = 0.2))
    grid.arrange(rp6_vrl)

 grid.arrange(rp6_allcargo, rp6_vrl, ncol = 2)

SOLVENCY RATIO Solvency ratios measure a company’s ability to meet its long-term financial obligations and ensure it remains financially stable in the future. These ratios are important for evaluating a company’s financial health and its capacity to sustain operations over time.

 #----------------------------------------

# Calculation of Debt-Equity-ratio
# Define groups from the items
total_debt <- c("Lg_TM_Borrowing","Sh_TM_Borrowings")  
total_sh_equity  <- c("Eq_ShareCap","Bonus_Equ_Sh_Cap","Revaluation_Reserv","ReserveandSurplus")      

#Finding the sum of items in each group year wise
sum_total_debt = tapply(vrl_bs_long$Amount[vrl_bs_long$Item %in% total_debt], vrl_bs_long$Year[vrl_bs_long$Item %in% total_debt], sum)
sum_total_sh_equity = tapply(vrl_bs_long$Amount[vrl_bs_long$Item %in% total_sh_equity], vrl_bs_long$Year[vrl_bs_long$Item %in% total_sh_equity], sum)

#Finding the ratio of sum in each group - yearwise
debt_equity_ratio <- sum_total_debt / sum_total_sh_equity

#creating dataframe
r7=data.frame(Year=names(debt_equity_ratio),
              Ratio=unname(debt_equity_ratio))

rp7_vrl=ggplot(r7,aes(x=Year,y=Ratio))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Ratio, group=1),
            col="blue",
            linewidth=2)+
 labs(x="Year",y="Debt-Equity-ratio",
       title="Debt-Equity-ratio Over year",
       caption = "Created by Team Logistics",
       subtitle="vrl logistics limited (2020 - 2024)")+
  geom_text(aes(label = round(Ratio, 2)), vjust = -1, color = "black")+  # Rounds to 2 decimal places+  # Display numbers above points
  scale_y_continuous(
    limits = c(0, 1),  # Set y-axis limits
    breaks = seq(0, 1, by = 0.2),  # Set the breaks on the y-axis
    labels = seq(0, 1, by = 0.2))  # Label the y-axis with values from 100 to 500
      grid.arrange(rp7_vrl)

grid.arrange(rp9_allcargo, rp7_vrl, ncol = 2)

#--------------------------------------------

#Calculation of Debt-asset Turnover Ratio
# Define groups from the items
total_debt <- c("Lg_TM_Borrowing","Sh_TM_Borrowings")       
total_asset <- c("Tan_Asset","Intan_Asset","Cap_Work_In_Progress","Non_Curr_Invest","DeferredTaxAsset_Net","Lg_Tm_LoansAndAdvanc","Oth_Non_Curr_ Asset","Curr_Invest","Inventories","Trade_Receiva","CashAndCash_Equi","Sh_Tm_LoansAnd Advanc","Oth_Curr_Assets")

#Finding the sum of items in each group year wise
sum_total_debt = tapply(vrl_bs_long$Amount[vrl_bs_long$Item %in% total_debt], vrl_bs_long$Year[vrl_bs_long$Item %in% total_debt], sum)
sum_total_asset = tapply(vrl_bs_long$Amount[vrl_bs_long$Item %in% total_asset], vrl_bs_long$Year[vrl_bs_long$Item %in% total_asset], sum)

#Finding the ratio of sum in each group - yearwise
debt_asset_ratio <-  sum_total_debt / sum_total_asset

#creating dataframe
r8 =  data.frame(Year=names(debt_asset_ratio),
                Ratio=unname(debt_asset_ratio))
#plot for ratio
rp8_vrl=ggplot(r8,aes(x=Year,y=Ratio))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Ratio, group=1),
            col="blue",
            linewidth=2)+
 labs(x="Year",y="Debt-asset Turnover Ratio",
       title="Debt-asset Turnover Ratio Over year",
       caption = "Created by Team Logistics",
       subtitle="vrl logistics limited (2020 - 2024)")+
  geom_text(aes(label = round(Ratio, 2)), vjust = -1, color = "black")+  # Rounds to 2 decimal places+  # Display numbers above points
  scale_y_continuous(
    limits = c(0, 1),  # Set y-axis limits
    breaks = seq(0, 1, by = 0.2),  # Set the breaks on the y-axis
    labels = seq(0, 1, by = 0.2))  # Label the y-axis with values from 100 to 500
    grid.arrange(rp8_vrl)

grid.arrange(rp7_allcargo, rp8_vrl, ncol = 2)

#--------------------------------------------

#Calculation of Debt-Capital Turnover Ratio
# Define groups from the items
total_debt <- c("Lg_TM_Borrowing","Sh_TM_Borrowings")       
total_asset <- c("Tan_Asset","Intan_Asset","Cap_Work_In_Progress","Non_Curr_Invest","DeferredTaxAsset_Net","Lg_Tm_LoansAndAdvanc","Oth_Non_Curr_ Asset","Curr_Invest","Inventories","Trade_Receiva","CashAndCash_Equi","Sh_Tm_LoansAnd Advanc","Oth_Curr_Assets")

#Finding the sum of items in each group year wise
sum_total_debt = tapply(vrl_bs_long$Amount[vrl_bs_long$Item %in% total_debt], vrl_bs_long$Year[vrl_bs_long$Item %in% total_debt], sum)
sum_total_asset = tapply(vrl_bs_long$Amount[vrl_bs_long$Item %in% total_asset], vrl_bs_long$Year[vrl_bs_long$Item %in% total_asset], sum)

#Finding the ratio of sum in each group - yearwise
debt_asset_ratio <-  sum_total_debt / sum_total_asset

#creating dataframe
r9 = data.frame(Year=names(debt_asset_ratio),
                Ratio=unname(debt_asset_ratio))

#plot for ratio
rp9_vrl=ggplot(r9,aes(x=Year,y=Ratio))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Ratio, group=1),
            col="blue",
            linewidth=2)+
  geom_text(aes(label = round(Ratio, 2)), vjust = -1, color = "black")+  # Rounds to 2 decimal places+  # Display numbers above points
  labs(x="Year",y=" Debt-Capital Turnover Ratio",
       title=" Debt-Capital Turnover Ratio Over year",
       caption = "Created by Team Logistics",
       subtitle="vrl logistics limited (2020 - 2024)")+
  geom_text(aes(label = round(Ratio, 2)), vjust = -1, color = "black")+  # Rounds to 2 decimal places+  # Display numbers above points
  scale_y_continuous(
    limits = c(0, 1),  # Set y-axis limits
    breaks = seq(0, 1, by = 0.2),  # Set the breaks on the y-axis
    labels = seq(0, 1, by = 0.2))  # Label the y-axis with values from 100 to 500
    grid.arrange(rp9_vrl)

grid.arrange(rp8_allcargo, rp9_vrl, ncol = 2)

#--------------------------------------------

#Calculation of Financial Leverage Ratio
# Define groups from the items
avg_total_asset <- c("Tan_Asset","Intan_Asset","Cap_Work_In_Progress","Non_Curr_Invest","DeferredTaxAsset_Net","Lg_Tm_LoansAndAdvanc","Oth_Non_Curr_ Asset","Curr_Invest","Inventories","Trade_Receiva","CashAndCash_Equi","Sh_Tm_LoansAnd Advanc","Oth_Curr_Assets")       
avg_total_equity <- c("Eq_ShareCap","ReserveandSurplus")

#Finding the sum of items in each group year wise
sum_avg_total_asset = tapply(vrl_bs_long$Amount[vrl_bs_long$Item %in% avg_total_asset], vrl_bs_long$Year[vrl_bs_long$Item %in% avg_total_asset], sum)
sum_avg_total_equity = tapply(vrl_bs_long$Amount[vrl_bs_long$Item %in% avg_total_equity], vrl_bs_long$Year[vrl_bs_long$Item %in% avg_total_equity], sum)

#Finding the ratio of sum in each group - yearwise#Finding the ratio of sum in each group - yearwisesum
financial_leverage <-  sum_avg_total_asset / sum_avg_total_equity

#creating dataframe
r10 = data.frame(Year=names(financial_leverage),
                 Ratio=unname(financial_leverage))
#plot of ratio
rp10_vrl=ggplot(r10,aes(x=Year,y=Ratio))+
  geom_point(col="red",size=5)+
  geom_line(aes(x=Year,Ratio, group=1),
            col="blue",
            linewidth=2)+
  labs(x="Year",y=" Financial Leverage Ratio",
       title=" Financial Leverage Ratio Over year",
       caption = "Created by Team Logistics",
       subtitle="vrl logistics limited (2020 - 2024)")+
  geom_text(aes(label = round(Ratio, 2)), vjust = -1, color = "black")+  # Rounds to 2 decimal places+  # Display numbers above points
   scale_y_continuous(
    limits = c(0, 3),  # Set y-axis limits
    breaks = seq(0, 3, by = 0.5),  # Set the breaks on the y-axis
    labels = seq(0, 3, by = 0.5))  # Label the y-axis with values from 100 to 500
    grid.arrange(rp10_vrl)

grid.arrange(rp10_allcargo, rp10_vrl, ncol = 2)

PROFITABILITY RATIO Profitability ratios assess how well a company generates profit relative to its revenue, assets, or equity. These ratios are crucial for determining a company’s ability to make money and evaluating its overall financial success.

#calcualtion of operating profit margin
# Define groups from the items
#OPERATING PROFIT MARGIN = OPERATING PROFIT/REVENUE FROM OPERATION)*100 
#OPERATING PROFIT = Total operating Revenue-(operating and direct expenses+Employee Benefit Expenses+depreciation+other operating cost)
vrl_pl_long<-data.frame(year = c(2020,2021,2022,2023,2024),
                        Total_operating_revenue=c(2118.54,1762.92,2393.65,2648.52,2888.62),
                        Opr_and_dir_Exp=c(1410.20,1181.75,1591.65,1799.03,1966.75),
                        EmployeeBenefitExp=c(380.51,314.66,372.02,414.85,485.13),
                        DepAndAmortExp=c(167.53,159.79,168,159.14,216.16),
                        OtherExp=c(29.56,19.03,25.81,32.99,43.29))

#calculate operating profit 
vrl_pl_long$operating_profit <- vrl_pl_long$Total_operating_revenue-(vrl_pl_long$Opr_and_dir_Exp
                                                                     +vrl_pl_long$EmployeeBenefitExp
                                                                     +vrl_pl_long$DepAndAmortExp
                                                                     +vrl_pl_long$OtherExp)
#calculate operating profit margin
operating_profit_margin <- (vrl_pl_long$operating_profit / vrl_pl_long$Total_operating_revenue) *100

#view results
print(vrl_pl_long)
##   year Total_operating_revenue Opr_and_dir_Exp EmployeeBenefitExp
## 1 2020                 2118.54         1410.20             380.51
## 2 2021                 1762.92         1181.75             314.66
## 3 2022                 2393.65         1591.65             372.02
## 4 2023                 2648.52         1799.03             414.85
## 5 2024                 2888.62         1966.75             485.13
##   DepAndAmortExp OtherExp operating_profit
## 1         167.53    29.56           130.74
## 2         159.79    19.03            87.69
## 3         168.00    25.81           236.17
## 4         159.14    32.99           242.51
## 5         216.16    43.29           177.29
#Create a dataframe for operating profit margin 
r11_vrl_long<- data.frame(Year = vrl_pl_longq_r$year, Ratio =operating_profit_margin )

# Create ggplot for operating profit margin
rp11_vrl <- ggplot(r11_vrl_long, aes(x = Year, y = Ratio)) +
  geom_point(color = "blue", size = 5) +
  geom_line(aes(group = 1), color = "yellow", linewidth = 2) +
  labs(x = "Year", y = "OPERATING PROFIT MARGIN",
       title = "OPERATING PROFIT MARGIN Over the Years",
       subtitle = "VRL Logistics Limited (2020 - 2024)",
       caption = "Created by Team Logistics") +
  geom_text(aes(label = round(Ratio, 2)), vjust = -1, color = "red") +  # Display rounded values
  scale_y_continuous(
    limits = c(0, 10),  # Set y-axis limits
    breaks = seq(0, 10, by = 2),  # Set y-axis breaks
    labels = seq(0, 10, by = 2) )

# Print the plot

 grid.arrange(rp11_vrl)

grid.arrange(rp11_allcargo, rp11_vrl, ncol = 2)