Description Usage Arguments Details See Also Examples
Use corrheatOutput
to create a UI element, and renderCorrheat
to render the heatmap.
1 2 3 | corrheatOutput(outputId, width = "100%", height = "400px")
renderCorrheat(expr, env = parent.frame(), quoted = FALSE)
|
outputId |
Output variable to read from |
width, height |
The width and height of the map (see shinyWidgetOutput) |
expr |
An expression that generates a |
env |
The environment in which to evaluate |
quoted |
Is |
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.
corrheat
, d3heatmapOutput
,
renderD3heatmap
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.