R/clean_vector.R

Defines functions clean_vector

Documented in clean_vector

#' Internal to simulate_non_independence2()
#'
#' Puts vector string in numeric order
#'
#' @param cell a t2$vector cell
#' @keywords internal
clean_vector <- function(cell){
  x <- stringr::str_split(cell, "-")[[1]]
  y <- stringr::str_split(cell, "-")[[1]][order(characterRank(x))] %>%
    paste(collapse = "-")
  return(y)
}
gavincotterill/modulr documentation built on Nov. 30, 2022, 11:15 p.m.