R/unwrap_cohort.R

Defines functions unwrap_cohort

unwrap_cohort <- function(tbl_json) {

  tbl_json %>%
    tidyjson::spread_values(
      cohort_symbol = tidyjson::jstring('name_short'),
      cohort_name = tidyjson::jstring('name_full')) %>%
    # Convert from tbl_json to plain and simple tibble
    tidyjson::as_tibble()
}

Try the quincunx package in your browser

Any scripts or data that you put into this service are public.

quincunx documentation built on July 9, 2023, 7:32 p.m.