r paste0(MPS_CHUNK, ": ", Standards_details$Context[Standards_details$Standard == MPS_CHUNK])

r Standards_details$Details[Standards_details$Standard == MPS_CHUNK]

MPS_TASKS <- perf_status_mps_temp %>%
  dplyr::filter(Standard == MPS_CHUNK) %>%
  dplyr::pull(TaskVolume)

MPS_PERF <- perf_status_mps_temp %>%
  dplyr::filter(Standard == MPS_CHUNK) %>%
  dplyr::pull(Performance)

MPS_SUMPERF3M <- perf_status_mps_temp %>%
  dplyr::filter(Standard == MPS_CHUNK) %>% 
  dplyr::pull(SumPerf3m)

For r format(data.period, "%B-%Y"), r SHORT.NAME had:

Below is a graph showing r SHORT.NAME's historical performance against r MPS_CHUNK. MOSL action points and Rectification milestones are shown, if applicable.

on_plan <- perf_status_mps_temp %>%
  dplyr::filter(Standard == MPS_CHUNK) %>%
  dplyr::pull(Rectification)

graph <- perf_status_mps %>%
  dplyr::filter(TaskVolume > 0) %>%
  MOSLR::plot_perf_graph(
    df = ., 
    load.data = FALSE,
    standard = MPS_CHUNK,
    trading.party = TRADING.PARTY,
    period.start = data.period %m-% months(11),
    period.end = data.period, 
    action.points = TRUE,
    include.iprp = on_plan,
    graph.title = MPS_CHUNK,
    sub.title = Standards_details$Context[Standards_details$Standard == MPS_CHUNK],
    ) +
  ggplot2::theme(text = ggplot2::element_text(size = 15))

tryCatch(
  expr = {
    plot(graph)
    },
  error = function(e){
    print(e)
  }
  )

For r MPS_CHUNK there have been r dplyr::if_else(is.na(MPS_SUMPERF3M), 0, MPS_SUMPERF3M) performance flag(s) over the last 12 months.

r if (on_plan) { paste0(MPS_CHUNK, " is currently on a Rectification plan. See below for further details.") }


RATIONALE_CHUNK <- perf_status_mps %>% 
  dplyr::filter(
    Period >= data.period %m-% months(6),
    Trading.Party.ID == TRADING.PARTY, 
    Standard == MPS_CHUNK, 
    Action != ""
    ) %>%
  nrow() > 0

PFM_COMM_CHUNK <- perf_status_mps %>% 
  dplyr::filter(
    Period >= data.period %m-% months(6),
    Trading.Party.ID == TRADING.PARTY, 
    Standard == MPS_CHUNK, 
    !is.na(PFM_Commentary), 
    PFM_Commentary != ""
    ) %>%
  nrow() > 0

r if (RATIONALE_CHUNK) { paste0("The table below shows the rationale for MOSL actions regarding ", paste0(MPS_CHUNK), ".") }

``` {r message = FALSE, echo = FALSE, error = FALSE, warning = FALSE, results = "asis", eval = RATIONALE_CHUNK}

comment_date <- perf_status_mps_temp %>% dplyr::filter(Standard == MPS_CHUNK) %>% dplyr::mutate( check = any(OnWatch, Rectification, PerfFlag3m, UnderReview), date = dplyr::if_else(check, as.Date("2018-04-01"), as.Date(data.period %m-% months(6))) ) %>% dplyr::pull(date)

perf_status_mps %>% dplyr::filter( Period >= comment_date, Trading.Party.ID == TRADING.PARTY, Standard == MPS_CHUNK, Action != "" ) %>% dplyr::select(Period, Action, Rationale) %>% dplyr::mutate(Period = format(as.Date(Period), "%Y-%m")) %>% kableExtra::kable( format = "latex", caption = paste0("Rationale for Recent MOSL Actions for ", MPS_CHUNK), linesep = "", #longtable = TRUE, booktabs = TRUE, col.names = c("Period", "Action", "Rationale") ) %>% kableExtra::column_spec(3, width = "10cm") %>% kableExtra::kable_styling( font_size = 10, latex_options = c( "repeat_header", "HOLD_position", full_width = FALSE, "striped" ) ) %>% kableExtra::row_spec(0, bold = TRUE)

<br> 

`r if (PFM_COMM_CHUNK) { paste0("The table below shows MOSL commentary regarding ",  paste0(MPS_CHUNK), ".") }`

``` {r message = FALSE, echo = FALSE, error = TRUE, warning = FALSE, results = "asis", eval = PFM_COMM_CHUNK}

perf_status_mps %>%
  dplyr::filter(
    Period >= comment_date,
    Trading.Party.ID == TRADING.PARTY,
    Standard == MPS_CHUNK,
    !is.na(PFM_Commentary), 
    PFM_Commentary != ""
    ) %>%
  dplyr::select(Period, PFM_Commentary) %>%
  dplyr::mutate(Period = format(as.Date(Period), "%Y-%m")) %>%
  kableExtra::kable(
    format = "latex", 
    caption = paste0("MOSL Commentary for ", MPS_CHUNK),
    linesep = "",
    #longtable = TRUE, 
    booktabs = TRUE,
    col.names = c("Period", "Commentary")
    ) %>%
  kableExtra::column_spec(2, width = "12cm") %>%
  kableExtra::kable_styling(
    font_size = 10,
    latex_options = c(
      "repeat_header",
      "HOLD_position",
      "striped"
      )
    ) %>%
  kableExtra::row_spec(0, bold = TRUE)


r if (on_plan) { paste0("A summary of ", SHORT.NAME, "'s performance against its Rectification plan is shown in the table below.") }

``` {r message = FALSE, echo = FALSE, error = TRUE, warning = FALSE, results = "asis", eval = on_plan}

table <- perf_status_mps %>% dplyr::filter( Trading.Party.ID == TRADING.PARTY, Standard == MPS_CHUNK, ) %>% dplyr::mutate_if(is.numeric, scales::percent_format(accuracy = 1)) %>% dplyr::select(Period, Performance, Planned_Perf, DeltaQuant, Status) %>% tidyr::drop_na() %>% dplyr::mutate(Period = format(as.Date(Period), "%Y-%m"))

if (nrow(table) > 0) {

table %>% kableExtra::kable( format = "latex", caption = "Rectification Performance Tracking", linesep = "", #longtable = TRUE, booktabs = TRUE, col.names = c( "Period", "Actual Performance", "Planned Performance", "Relative Difference", "Rectification Status" ), align = rep("c", 5) ) %>% kableExtra::column_spec(1:5, width = "2.5cm") %>% kableExtra::kable_styling( font_size = 10, latex_options = c( "repeat_header", "HOLD_position", "striped" ) ) %>% kableExtra::row_spec(0, bold = TRUE)

}

```


r if (on_plan) { paste0("For this plan there have been:") }

r if (on_plan) { paste0("* ", perf_status_mps_temp$CumResubmit[perf_status_mps_temp$Standard == MPS_CHUNK], " resubmission(s)") } r if (on_plan) { paste0("* ", sum(perf_status_mps_temp$UnderReview[perf_status_mps_temp$Standard == MPS_CHUNK]), " review(s)") }



austl001/MOSLR documentation built on Aug. 17, 2022, 12:07 a.m.