R/get_connection.R

Defines functions get_connect

# Generate connections
#' @keywords internal
get_connect <- function(consort_plot){
  
  connection <- sapply(names(consort_plot), function(x){
    prev_node <- consort_plot[[x]]$prev_node
    
    if(is.null(prev_node))
      return(NULL)
    else
      list(node = c(x, prev_node),
           connect = ifelse(is.null(consort_plot[[x]]$side), "bt",
                            ifelse(consort_plot[[x]]$side== "right", "bl", "br")) )
    
  })
  Filter(Negate(is.null), connection)
  
}

Try the consort package in your browser

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

consort documentation built on June 22, 2024, 10 a.m.