metrumresearchgroup / pmforest

Create forest plots
https://metrumresearchgroup.github.io/pmforest
Other
2 stars 0 forks source link

Add validation documents #1

Closed seth127 closed 2 years ago

seth127 commented 2 years ago

This branch adds the content and code necessary to automatically build the validation documents required by Metrum Research Group to use this package in validated scientific work.

seth127 commented 2 years ago

For posterity, this is how I moved the stories from the googlesheet we were using before into YAML files:

dd <- googlesheets4::read_sheet(ss = "ID_FOR_THE_GOOGLESHEET")

library(dplyr)
library(stringr)
library(purrr)

dl <- dd %>%
  rename(
    name = StoryName,
    description = StoryDescription,
    tests = TestIds
  ) %>%
  split(seq(nrow(dd))) %>%
  setNames(dd$StoryId) %>%
  map(~ {
    .x <- as.list(.x)
    .x$StoryId <- NULL
    .x$tests <- unlist(str_split(.x$tests, ", *"))
    .x
  })

yaml::write_yaml(dl, "inst/validation/pmforest-stories.yaml")
barrettk commented 2 years ago

For posterity, this is how I moved the stories from the googlesheet we were using before into YAML files:

dd <- googlesheets4::read_sheet(ss = "ID_FOR_THE_GOOGLESHEET")

library(dplyr)
library(stringr)
library(purrr)

dl <- dd %>%
  rename(
    name = StoryName,
    description = StoryDescription,
    tests = TestIds
  ) %>%
  split(seq(nrow(dd))) %>%
  setNames(dd$StoryId) %>%
  map(~ {
    .x <- as.list(.x)
    .x$StoryId <- NULL
    .x$tests <- unlist(str_split(.x$tests, ", *"))
    .x
  })

yaml::write_yaml(dl, "inst/validation/pmforest-stories.yaml")

Sounds good - I like that idea much more

seth127 commented 2 years ago

After discussing with the team, we're going to move forward with keeping this interactive script in inst/validation and potentially move to something like a Makefile later.

We should also consider if at some point it makes sense to move the majority of this script into its own wrapper function in mrgvalprep.