library(shiny)
library(dplyr)
library(ggplot2)
library(cea20160329)
shinyServer(function(input, output) {
# Envia um gráfico para o ui.R
output$distPlot <- renderPlot({
dados <- pnud %>%
filter(ano == 2010)
# Isso aqui é a sintaxe do pacote "ggplot2"
p <- ggplot(dados, aes(x=idhm_l, y=idhm_e, size=idhm_r)) +
geom_point(alpha = 0.1, colour = 'darkgreen') +
theme_bw()
# Se o smooth estiver tickado...
if(input[['smooth']] == TRUE) {
p <- p + geom_smooth()
}
print(p)
})
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.