completeness_heatmap {eHDPrep}R Documentation

Completeness Heatmap

Description

Produces a heatmap visualising completeness across a dataset.

Usage

completeness_heatmap(
  data,
  id_var,
  annotation_tbl = NULL,
  method = 1,
  show_rownames = FALSE,
  ...
)

Arguments

data

Data frame to be analysed.

id_var

Character constant of row identifier variable name.

annotation_tbl

Data frame containing variable annotation data. Column 1 should contain variable names, column 2 should contain an annotation label.

method

Integer between 1 and 3. Default: 1. See Details for more information.

show_rownames

Boolean. Should rownames be shown. Default: False.

...

Parameters to be passed to pheatmap.

Details

Value

completeness heatmap

Note

If the heatmap overlaps with other plots on the current device, it is recommended that users run the grid.newpage function to ensure a clean page is used for this plot.

References

Kolde R (2019). _pheatmap: Pretty Heatmaps_. R package version 1.0.12, <https://CRAN.R-project.org/package=pheatmap>.

See Also

pheatmap

Other measures of completeness: assess_completeness(), compare_completeness(), plot_completeness(), row_completeness(), variable_completeness()

Examples

data(example_data)
completeness_heatmap(example_data,patient_id)

# with variable-level annotations
## create a dataframe containing variable annotations
tibble::tribble(~"var", ~"datatype",
"patient_id", "id",
"tumoursize", "numeric",
"t_stage", "ordinal_tstage",
"n_stage", "ordinal_nstage",
"diabetes", "factor",
"diabetes_type", "ordinal",
"hypertension", "factor",
"rural_urban", "factor",
"marital_status", "factor",
"SNP_a", "genotype",
"SNP_b", "genotype",
"free_text", "freetext") -> data_types

completeness_heatmap(example_data,patient_id, annotation_tbl = data_types)

[Package eHDPrep version 1.2.1 Index]