corrheatOutput: Wrapper functions for using corrheat in shiny

Description Usage Arguments Details See Also Examples

View source: R/corrheat.R

Description

Use corrheatOutput to create a UI element, and renderCorrheat to render the heatmap.

Usage

1
2
3
corrheatOutput(outputId, width = "100%", height = "400px")

renderCorrheat(expr, env = parent.frame(), quoted = FALSE)

Arguments

outputId

Output variable to read from

width, height

The width and height of the map (see shinyWidgetOutput)

expr

An expression that generates a d3heatmap object

env

The environment in which to evaluate expr

quoted

Is expr a quoted expression (with quote())? This is useful if you want to save an expression in a variable.

Details

Note that this is not a priority in the least for me at this time, but I went ahead and ported the d3heatmap code and at least the following example will work fine.

See Also

corrheat, d3heatmapOutput, renderD3heatmap

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
library(heatR)
library(shiny)

ui = fluidPage(
  h1('A corrheat demo'),
  selectInput('data', 'Data', c('mtcars', 'bfi', 'state.x77'), selected='bfi'),
  corrheatOutput('heatmap')
)

server = function(input, output) {
  datasetInput = reactive({
    switch(input$data,
           'mtcars' = mtcars,
           'bfi' = bfi,
           'state.x77' = state.x77)
  })
  output$heatmap = renderCorrheat({
    corrheat(cor(datasetInput(), use='pair'))
  })
}

shinyApp(ui, server)

m-clark/heatR documentation built on May 21, 2019, 9:17 a.m.