plotDataTemporalMap-methods: Data Temporal heatmap

Description Usage Arguments Value Examples

Description

Plots a Data Temporal heatmap from an DataTemporalMap object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
plotDataTemporalMap(
  dataTemporalMap,
  absolute = FALSE,
  startValue = 1,
  endValue = ncol(dataTemporalMap@probabilityMap),
  startDate = min(dataTemporalMap@dates),
  endDate = max(dataTemporalMap@dates),
  sortingMethod = "frequency",
  colorPalette = "Spectral",
  mode = "heatmap"
)

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

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).

mode

indicates the plot mode as a 'heatmap' (default) or 'series'. The other config parameters for the heatmap plot also apply for the series plot.

Value

A plot object based on the plotly package.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
load(system.file("extdata",
                 "variabilityDemoNHDSdiagcode1-phewascode.RData",
                  package="EHRtemporalVariability"))

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

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

## Not run: 

# For additional and larger examples download the following .Rdata file:

gitHubUrl  <- 'http://github.com/'
gitHubPath <- 'hms-dbmi/EHRtemporalVariability-DataExamples/'
gitHubFile <- 'raw/master/variabilityDemoNHDS.RData'
inputFile  <-  paste0(gitHubUrl, gitHubPath, gitHubFile)

load(url(inputFile))
plotDataTemporalMap(probMaps$`diagcode1-phewascode`, startValue = 2, endValue = 40)

## End(Not run)

EHRtemporalVariability documentation built on May 31, 2021, 5:07 p.m.