(PART) Fingerprints of the analyses {-}

results %>%
  distinct(scientific_name, Area = LocationGroup, Model = ModelType, Duration,
           Status, FileFingerprint, StatusFingerprint, Nederlands) %>%
  mutate(
    Model = str_replace(Model, "aggregate imputed: max ~ Year",
                        "wintermaximum per year") %>%
      str_replace("aggregate imputed: sum ~ Year \\+ Month",
                  "monthly total per year") %>%
      str_replace("imputed average: Total ~ cPeriod",
                  "average wintermaximum") %>%
      str_replace("imputed trend: Total ~ Year \\+ Month",
                  "linear trend monthly totals") %>%
      str_replace("yearly imputed index: Total ~ Year \\+ Month",
                  "non-linear trend monthly totals") %>%
      str_replace("inla nbinomial: Year \\* \\(Month \\+ Location\\)",
                  "imputation"),
    id = abbreviate(scientific_name, 10),
    Fingerprints = paste(str_trunc(FileFingerprint, 20),
                         str_trunc(StatusFingerprint, 20), sep = "\n")
  ) %>%
  select(-FileFingerprint, -StatusFingerprint) %>%
  arrange(Area, Model, Duration) -> fingerprints
fingerprints %>%
  distinct(scientific_name, id) %>%
  arrange(scientific_name) %>%
  pull(id) %>%
  sapply(
    function(id) {
      knit_expand("_fingerprints.Rmd", id = id)
    }
  ) %>%
  paste(collapse = "\n\n") -> rmd
knit(text = rmd, quiet = TRUE) %>%
  cat()


inbo/watervogelanalysis documentation built on Oct. 10, 2024, 7:17 a.m.