.libPaths("/home/thui/R/libs/") library(shiny) library(datasets) library(ggplot2) # Define server logic required to plot various variables against mpg shinyServer(function(input, output) { histbin <- read.csv(file = "~/epigenomics/manuscript/histone_chip/histone_chip_chr1_log_shiny.csv") # Return the formula text for printing as a caption output$caption <- renderText({ paste0("log10 signal for", input$mark, "chIP-seq in vitC and untreated cells") }) # Generate a plot of the requested variable against mpg and only # include outliers if requested output$mpgPlot <- renderPlot({ subhist <- subset(histbin, mark == input$mark) ggplot(subhist, aes(lunt, lvitc)) + geom_point(alpha = 0.2, size = 0.5) + #stat_density2d(aes(fill = ..density..), geom="tile", contour=FALSE) + theme_bw() + geom_abline(slope=1) }) })