formatResults: Pretty format statistical analysis results helper

View source: R/transformationFunctions.R

formatResultsR Documentation

Pretty format statistical analysis results helper

Description

formatResults format statistical analysis results table to html or latex format.

Usage

formatResults(
  results,
  filter_by = "p.value <= 0.05",
  arrange_by = "p.value",
  select_cols = c("term", "estimate", "std.error", "p.value", "p.adjusted"),
  format = c("html", "latex"),
  header = NULL,
  scroll_box_height = "400px"
)

Arguments

results

Tibble as returned by runMiDAS.

filter_by

Character vector specifying conditional expression used to filter results, this is equivalent to ... argument passed to filter.

arrange_by

Character vector specifying variable names to use for sorting. Equivalent to ... argument passed to arrange.

select_cols

Character vector specifying variable names that should be included in the output table. Can be also used to rename selected variables, see examples.

format

String "latex" or "html".

header

String specifying header for result table. If NULL no header is added.

scroll_box_height

A character string indicating the height of the table.

Value

Character vector of formatted table source code.

Examples

## Not run: 
midas <- prepareMiDAS(hla_calls = MiDAS_tut_HLA,
                      colData = MiDAS_tut_pheno,
                      experiment = "hla_alleles")
object <- lm(disease ~ term, data = midas)
res <- runMiDAS(object, 
                experiment = "hla_alleles", 
                inheritance_model = "dominant")
formatResults(res,
              filter_by = c("p.value <= 0.05", "estimate > 0"),
              arrange_by = c("p.value * estimate"),
              select_cols = c("allele", "p-value" = "p.value"),
              format = "html",
              header = "HLA allelic associations")

## End(Not run)


Genentech/midasHLA documentation built on Feb. 12, 2024, 9:38 a.m.