f_plot_profit_lines: plot revenues cost and profit development over time as an...

Description Usage Arguments Details Value Examples

View source: R/f_plot_profit.R

Description

the function can graphically devide the chart into two periods e.g. past and future.

Usage

1
2
3
f_plot_profit_lines(data, col_revenue, col_cost, col_time, now = max(data[,
  col_time]), unit_time = "years", unit_value = "CHF", title = "",
  alpha_past = 1, alpha_future = 0.5)

Arguments

data

datafram

col_revenue

character vector denoting revenue column

col_cost

character vector denoting cost column

col_time

character vector denoting time column

now

integer denoting a time which should be regarded as the breakpoint, Default: max(data[, col_time])

unit_time

character vector, will label y-axis, Default: 'years'

unit_value

character vector, will label x-axis, Default: 'CHF'

title

character vector, will be title label, Default: ”

alpha_past

double between 0 and 1 will determine alpha value for fill under the curve before the breakpoint, Default: 1

alpha_future

double between 0 and 1 will determine alpha value for fill under the curve after the breakpoint, Default: 0.5

Details

not plotly compatibel

Value

plot (is not plotly compatibel)

Examples

1
2
3
4
5
6
7
data = tibble( time     = c(0,1,2,3,4,5,6,7,8,9,10)
              , revenue = - time^2 + time * 12
              , cost    = revenue * 0.4 * -1
             )

print( f_plot_profit_lines( data, 'revenue', 'cost', 'time') )
print( f_plot_profit_lines( data, 'revenue', 'cost', 'time', now = 5) )

erblast/oetteR documentation built on Aug. 4, 2018, 11:03 p.m.