gg_utility_of_pay: Generate a simple plotting function of the utility for a...

Description Usage Arguments Value Examples

View source: R/gg_utility_of_pay.R

Description

Function expects "make_willingness_utility" function output as data

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
gg_utility_of_pay(
  x,
  jump = 5,
  float = 0.5,
  cost = 0,
  tit = "",
  xsize = 15,
  yl = "Expected Utility (Price * Willingness to Pay)",
  xl = "Price (ILS)"
)

Arguments

x

a tbl() that is the output of make_willingness_utility()

jump

by default ==5 jumps between labels

cost

by default ==0 a constant to reduce from utility

tit

by default = "Willingness to Pay",

xsize

by default = 15, text size

yl

y label, by default = "Percent Willing to Pay"

xl

x label, by default = "Price (ILS)"

Value

the function generates ggplot curve of the Expected Utility

Examples

1
2
3
4
5
6
7
8
9
 quality_assurance <- data.frame(
 ID = 1:500,
 money_willing_to_pay = sample(seq(0,20,5), size = 500, replace = T),
 year = sample(c("2018", "2019", "2020"), size = 500, replace = T))

 input <- quality_assurance %>%
   saridr::make_willingness_utility(money_pay_var_string = "money_willing_to_pay")

 gg_utility_of_pay(x=input,jump=5)

sarid-ins/saridr documentation built on Nov. 10, 2020, 9:07 p.m.