Capsim Draft

Code
# raw_sheets <- import_list("../Other/capsim/raw.xlsx", setclass = "tibble")
raw_sheets <- import_list("raw.xlsx", setclass = "tibble")

# clean_sheets <- lapply(raw_sheets, function(x) {
#   x %>%
#     t() %>%
#     as.data.frame() %>%
#     row_to_names(row_number = 1)
# }) 


master <- bind_rows(raw_sheets, .id = "Round")
Code
master_clean <- master |>
  mutate(
    year = as.integer(str_sub(Round, start = -1)) + 2024,
    sales = Sales...8,
    ebit = EBIT...9,
  ) |>
  select(
    -c(
      "Sales...59",
      "EBIT...65",
      "EBIT...64",
      "...39",
      "...40",
      "...51",
      "...52",
      "...62",
      "...63",
      "Sales...64",
      "EBIT...70",
      "EBIT...9",
      "Sales...8",
      # "Income Statement Survey",
      "Cash flows from financing activities"
    )
  )
Code
ggplot(master_clean, aes(x=year, y=sales, colour = company, group = company)) +
  geom_line(linewidth = 1.4) +
  theme_bw() +
  labs(title = "Sales per Year")

Code
ggplot(master_clean, aes(x=year, y=Close, colour = company, group = company)) +
  geom_line(linewidth = 1.4) +
  theme_bw() +
  labs(title = "Stock Price per Year")

Code
ggplot(master_clean, aes(fill = company, y=`market share`, x=year)) +
  geom_col(position = "fill") +
  theme_bw() +
  labs(title = "Market Share per Year")

Code
ggplot(master_clean, aes(x=year, y=-1*(`Plant improvements (net)`), colour = company, group = company)) +
  geom_line(linewidth = 1.4) +
  theme_bw() +
  labs(title = "Cash Spent on Plant Improvements per Year")