library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.4.3
library(plotly)
## Warning: package 'plotly' was built under R version 4.4.3
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
library(gganimate)
## Warning: package 'gganimate' was built under R version 4.4.3
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(lubridate)
## Warning: package 'lubridate' was built under R version 4.4.3
## 
## Attaching package: 'lubridate'
## The following objects are masked from 'package:base':
## 
##     date, intersect, setdiff, union
library(viridis)
## Warning: package 'viridis' was built under R version 4.4.3
## Loading required package: viridisLite
## Warning: package 'viridisLite' was built under R version 4.4.3
library(hrbrthemes)
## Warning: package 'hrbrthemes' was built under R version 4.4.3
library(gifski)
## Warning: package 'gifski' was built under R version 4.4.3
library(png)
library(showtext)
## Warning: package 'showtext' was built under R version 4.4.3
## Loading required package: sysfonts
## Warning: package 'sysfonts' was built under R version 4.4.3
## Loading required package: showtextdb
## Warning: package 'showtextdb' was built under R version 4.4.3
library(knitr)
## Warning: package 'knitr' was built under R version 4.4.3
library(ragg)
## Warning: package 'ragg' was built under R version 4.4.3

Beximco Pharmaceuticals Ltd was founded in 1976 as a part of BEXIMCO group (BEXIMCO, 2025). Initially the company started by manufacutring products under the licenses of Bayer AG of Germany and Upjohn Inc. of United States (BEXIMCO, 2025). As of today the company has expanded to produce its own generic prescription drugs for several diseases (BEXIMCO, 2025). Being almost half a century in the market the company has risen to become on of the prominent yet controversial players in the industry. The following data takes a look into their share performance for the past five years (2020 - 2024) by taking into account variables such as daily trading volume, opening and closing price.

data <- read.csv("C:/Users/Nuzhat Tanisha/Documents/R Workshops Files/beximco.csv")


data$Date <- as.Date(data$Date, format="%m/%d/%Y")
data$Vol. <- as.numeric(gsub("K", "", data$Vol.)) * 1000  
## Warning: NAs introduced by coercion
str(data)
## 'data.frame':    1162 obs. of  7 variables:
##  $ Date    : Date, format: "2024-12-30" "2024-12-29" ...
##  $ Price   : num  81.6 82.1 81.4 81 81.6 83.1 85 85 84.5 84.2 ...
##  $ Open    : num  82.4 82.2 82.3 82.5 83.3 85.4 85.8 85 84 84.7 ...
##  $ High    : num  82.7 83.2 82.3 83.7 84 85.8 85.8 86.2 87.5 85.3 ...
##  $ Low     : num  81 81.8 80.3 80.4 81 82.8 84.7 84.2 84 83.5 ...
##  $ Vol.    : num  493930 508840 230010 454700 329180 ...
##  $ Change..: chr  "-0.61%" "0.86%" "0.49%" "-0.74%" ...
summary(data)
##       Date                Price             Open            High       
##  Min.   :2020-01-01   Min.   : 48.18   Min.   : 50.0   Min.   : 53.91  
##  1st Qu.:2021-05-03   1st Qu.:112.17   1st Qu.:112.8   1st Qu.:115.10  
##  Median :2022-07-20   Median :146.20   Median :146.2   Median :146.20  
##  Mean   :2022-07-18   Mean   :142.62   Mean   :143.1   Mean   :144.86  
##  3rd Qu.:2023-10-02   3rd Qu.:175.65   3rd Qu.:175.9   3rd Qu.:178.50  
##  Max.   :2024-12-30   Max.   :252.10   Max.   :254.9   Max.   :255.40  
##                                                                        
##       Low              Vol.          Change..        
##  Min.   : 47.36   Min.   :     0   Length:1162       
##  1st Qu.:109.55   1st Qu.: 10860   Class :character  
##  Median :146.20   Median :205875   Mode  :character  
##  Mean   :140.96   Mean   :283320                     
##  3rd Qu.:172.30   3rd Qu.:465033                     
##  Max.   :249.50   Max.   :997970                     
##                   NA's   :332
ggplot(data, aes(x = Date, y = Vol.)) +
  geom_bar(stat = "identity", fill = "#a4929f") +
  theme_minimal() +
  labs(title = "Daily Trading Volume",
       x = "Date",
       y = "Volume")
## Warning: Removed 332 rows containing missing values or values outside the scale range
## (`geom_bar()`).

plotly_bar <- ggplot(data, aes(x = Date, y = Vol.)) +
  geom_bar(stat = "identity", fill = "#a4929f") +
  theme_minimal() +
  labs(title = "Interactive Daily Trading Volume",
       x = "Date",
       y = "Volume")

ggplotly(plotly_bar)

The line chart below shows the daily closing price for the past five years (2020 - 2024) for Beximco Pharmaceuticals Ltd. It can be seen that their share price experienced an upward trajectory during mid 2020 till 2022.This effect can be attributed to the COVID-19 Pandemic. While all other industries suffered it was the Pharma industry that emerged as the winners during this period due to the high demand for prescription drugs. By 2022 the world had retured to its normal way as the pandemic died down. This pushed Beximco’s share prices to fall down. However, the fall was not as great as compared to their loss of market value that happened in late 2024. The student revolution in Bangladesh resulted in the corrupt leaders being charged with crime and as a close ally to the rulling party BEXIMCO suffered the blow. They were charged for various cases of corruption, including loan fraud (The Daily Star, 2025). This forced the company’s finance to lose ground leading them to fire several employees and close factories and businesses around the country (The Daily Star, 2025). As a result, as seen in the graph, their share prices had a steep fall during the end of 2024.

p_anim <- ggplot(data, aes(x = Date, y = Price)) +
  geom_line(color = "#da6dbf", size = 1) +
  geom_point(color = "#da6dbf", size = 2, alpha = 0.7) +
  scale_color_viridis(discrete = FALSE) +
  ggtitle("Stock Price Trend of Beximco Pharmaceuticals") +
  theme_ipsum() +
  theme(
    text = element_text(family = "sans"),
    plot.margin = margin(t = 30, r = 50, b = 20, l = 20), 
    plot.title = element_text(size = 10, face = "bold", hjust = 0.5)  
  ) +
  ylab("Closing Price") +
  xlab("Date") +
  transition_reveal(Date)
## 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.
animate(p_anim, renderer = gifski_renderer(), device = "ragg_png", width = 4, height = 3, res = 192)
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## not found in Windows font database
## Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)): font family
## not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database
## Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
## family not found in Windows font database

References

BEXIMCO - taking Bangladesh to the world. (2025). beximco.com. https://www.beximco.com/

Beximco lays off another 8,000 workers. (2025, February 4). The Daily Star. https://www.thedailystar.net/business/news/beximco-lays-another-8000-workers-3816111

Investing.com - stock market quotes & financial news. (2025). Investing.com. https://www.investing.com/