plotDataTemporalMap

0th

Percentile

Data Temporal heatmap

Plots a Data Temporal heatmap from an DataTemporalMap object.

Usage
plotDataTemporalMap(dataTemporalMap, absolute = FALSE, startValue = 1,
  endValue = ncol(dataTemporalMap@probabilityMap),
  startDate = min(dataTemporalMap@dates),
  endDate = max(dataTemporalMap@dates), sortingMethod = "frequency",
  colorPalette = "Spectral")

# S4 method for DataTemporalMap plotDataTemporalMap(dataTemporalMap, absolute = FALSE, startValue = 1, endValue = ncol(dataTemporalMap@probabilityMap), startDate = min(dataTemporalMap@dates), endDate = max(dataTemporalMap@dates), sortingMethod = "frequency", colorPalette = "Spectral")

Arguments
dataTemporalMap

of class DataTemporalMap

absolute

indicates if the heatmap frequency values are absolute or relative. By default FALSE.

startValue

indicates the first value to display in the heatmap. By default 1.

endValue

indicates the last value to display in the heatmap. By default the last value of the DataTemporalMap object.

startDate

a Date object indicating the first date to be displayed in the heatmap. By default the first date of the DataTemporalMap object.

endDate

a Date object indicating the last date to be displayed in the heatmap. By default the last date of the DataTemporalMap object.

sortingMethod

the method to sort data in the Y axis of the heatmap from "frequency" and "alphabetical", with "frequency" as default.

colorPalette

color palette to be used. The default "Spectral" palette shows a color temperature scheme from blue, through yellow, to red (see "Spectral" palette in RColorBrewer package). The four remaining options are better suited for those with colorblindness, including "Viridis", "Magma", and their reversed versions "Viridis-reversed" and "Magma-reversed" (see "Viridis" and "Magma" palettes in the Viridis package).

Value

A plot object based on the plotly package.

Aliases
  • plotDataTemporalMap
  • plotDataTemporalMap,DataTemporalMap-method
Examples
# NOT RUN {
load(system.file("extdata",
                 "variabilityDemoNHDSdiagcode1-phewascode.RData",
                  package="EHRtemporalVariability"))

p <- plotDataTemporalMap(dataTemporalMap =  probMaps[[1]],
                    colorPalette    = "Spectral",
                    startValue = 2,
                    endValue = 40)
p

# }
# NOT RUN {
# For additional and larger examples download the following .Rdata file:

githubURL <- "https://github.com/hms-dbmi/EHRtemporalVariability-DataExamples/raw/master/variabilityDemoNHDS.RData"
load(url(githubURL))
plotDataTemporalMap(probMaps$`diagcode1-phewascode`, startValue = 2, endValue = 40)
# }
Documentation reproduced from package EHRtemporalVariability, version 1.0, License: Apache License 2.0 | file LICENSE

Community examples

Looks like there are no examples yet.