plotPotencialGain | R Documentation |
plotPotencialGain(ds, regr, shiny)
ds |
|
regr |
|
shiny |
##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (ds, regr, shiny)
{
if (!shiny) {
ggplot() + geom_line(data = ds[!is.na(ds$sector), ],
aes(x = year, y = gain, group = sector, color = sector)) +
scale_y_log10() + ylab("Cota\303\247\303\243o")
}
else {
ui <- fluidPage(plotlyOutput("distPlot"))
server <- function(input, output) {
output$distPlot <- renderPlotly({
ggplot() + geom_line(data = ds[!is.na(ds$sector),
], aes(x = year, y = gain, group = sector,
color = sector)) + scale_y_log10() + ylab("Cota\303\247\303\243o")
})
}
shinyApp(ui = ui, server = server)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.