R/internal.R

Defines functions .function_igraphResultFormatting .function_merge_vInfo

.function_merge_vInfo <- function(dt, vInfo) {

  vInfo %>%
    select(level, levelName, vName) %>%
    right_join(dt, by = "vName")

}

.function_igraphResultFormatting <- function(igraphresult, name) {

  igraphresult %>%
    as.data.frame %>%
    rownames_to_column %>%
    setNames(c("vName", name)) %>%
    as_tibble()

}

.melt2 <- # Helper function to use pivot_longer in a way similar to reshape2::melt
  function(input, measure.vars, variable.name = "variable", value.name = "value") {
    input %>%
      pivot_longer(cols = all_of(measure.vars), names_to = variable.name, values_to = value.name)
  }
avisserquinn/AHgenPackage documentation built on Dec. 31, 2020, 7:54 p.m.