Skip to content

Instantly share code, notes, and snippets.

@mplourde
mplourde / gist:66322522df1001f218dd
Created May 30, 2014 18:24
plotting multiple ggplots in one window
library(grid)
plot1 <- ggplot(data.frame(x=1:10, y=1:10), aes(x=x, y=y)) + geom_point()
plot2 <- plot1
plot3 <- plot1
nrow <- 1
ncol <- 3
vp <- viewport(layout=grid.layout(nrow, ncol))
ui <- fluidPage(
fileInput('file', 'File'),
selectInput('col_select', 'Columns', choices=c(''), multiple=TRUE),
wellPanel(uiOutput('wellpanels'))
)
server <- function(input, output, session) {
data <- reactive({
f <- input$file
ui <- fluidPage(
tags$script('
Shiny.addCustomMessageHandler("toggleWellPanel",
function(message) {
document.getElementById(message["id"]).style.display = message["status"];
}
);
'),
fileInput('file', 'File'),
selectInput('col_select', 'Columns', choices=c(''), multiple=TRUE),