Closed seth127 closed 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")
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
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
.
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.
inst/validation/pmforest-stories.yaml
Suggests
dependencies added formrgvalidate
andmrgvalprep