I want to create a RShiny plot. When I launch the app, the sidebar is visible but there is no plot. What's causing the error?
Here's my code:
library(shiny)
ui <- fluidPage(
sidebarLayout(
sidebarPanel(
selectInput('xcol', 'X Variable', dimnames(dat)[[2]],
selected = rownames(dat)),
selectInput('ycol', 'Y Variable', dimnames(dat)[[2]],
selected = colnames(dat)),
selectInput('color', 'Point Color', c("red", "orange", "yellow", "green", "blue", "violet", "purple"))
),
mainPanel(
plotOutput('plot1')
)
)
)
server <- function(input, output) {
selectedData <- reactive({
dat[, c(input$xcol, input$ycol)]
})
output$plot<-renderPlot({
plot(dat$axis(side=1,at=c(1:24),labels=dimnames(dat)[[2]],cex.axis=0.4,las=2), dat$axis(side=2))
}
)
}
shinyApp(ui = ui, server = server)
snapshot of data
dput(dat[1:2,1:2])
structure(list(cdc15_10 = c(-0.16, NA), cdc15_30 = c(0.09, NA
)), row.names = c("YAL001C", "YAL002W"), class = "data.frame")