i want to create a heatmap from user csv file in shiny, so far i have succeeded in reading the table in Shiny and also got the heatmap. however, the row names from the input csv file are not shown in the heatmap. the column names seems to appear fine.
server function
plotdata <- eventReactive(input$getHmap, {
data <- as.matrix(data()[-1], )
row.names(data) <- data()$Name
data[is.na(data)] <- 0
data
})
output$theheatmap = renderPlot({
pheatmap(plotdata())
})
Pretty sure the UI script is fine..
#sliderbar for heatmap
conditionalPanel(condition = "$('li.active a').first().html()==='Heatmap'",
h2 ("Click the button to produce heatmap"),
actionButton('getHmap', 'get heatmap')),
mainpanel (
tabsetpanel (
tabPanel('Heatmap',
fluidRow(column(8, offset = 1,
h2("Heatmap"),
plotOutput("theheatmap"),
))
something is missing in the server function and i cant seem to get my head around it