plotPotencialGain: Plot potential gain

View source: R/functions.R

plotPotencialGainR Documentation

Plot potential gain

Usage

plotPotencialGain(ds, regr, shiny)

Arguments

ds
regr
shiny

Examples

##---- 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)
    }
  }

danielfhenrique789/profitmaximization documentation built on April 5, 2025, 4:05 p.m.