library(rtichoke)
create_gains_curve(
probs = list(example_dat$estimated_probabilities),
reals = list(c(rep(1, 21), rep(0, 129)))
)
#> Error in data.frame(reference_group = reference_group, x = reference_line_x_values, : arguments imply differing number of rows: 202, 203
The main problem is how length.out argument interprets 100*0.14:
length(seq(0, 1, length.out = 14))
#> [1] 14
length(seq(0, 1, length.out = 100*0.14))
#> [1] 15
Solution: wrap with as.integer()
length(seq(0, 1, length.out = as.integer(100*0.14)))
#> [1] 14
The main problem is how
length.outargument interprets 100*0.14:Solution: wrap with
as.integer()