inst/examples/loess-static/loess-static/server.R

suppressPackageStartupMessages({
    library(shiny)
    library(ggplot2)
})

# Create randomly generated data
xs <- seq(-10, 10, length.out = 100)
ys <- xs^2 + 15 * rnorm(100)

shinyServer(function(input, output) {
    output$mainplot <- renderPlot({
        suppressWarnings(print(
            qplot(xs, ys) +
            stat_smooth(method = "loess",
                        mapping = aes(colour = "red"),
                        se = FALSE,
                        span = input$spanalpha) +
            theme(legend.position = "none")
        ))
    }, width = 504, height = 504)
})
sjp/sjpMScThesis documentation built on May 30, 2019, 12:06 a.m.