Convert stats::stepfun
to data.frame
# S3 method for class 'stepfun'
fortify(model, data, ...)
stats::stepfun
instance
original dataset, if needed
other arguments passed to methods
data.frame
fortify(stepfun(c(1, 2, 3), c(4, 5, 6, 7)))
#> x y
#> 1 0 4
#> 2 1 4
#> 3 1 5
#> 4 2 5
#> 5 2 6
#> 6 3 6
#> 7 3 7
#> 8 4 7
fortify(stepfun(c(1), c(4, 5)))
#> x y
#> 1 0.9375 4
#> 2 1.0000 4
#> 3 1.0000 5
#> 4 1.0625 5
fortify(stepfun(c(1, 3, 4, 8), c(4, 5, 2, 3, 5)))
#> x y
#> 1 -1 4
#> 2 1 4
#> 3 1 5
#> 4 3 5
#> 5 3 2
#> 6 4 2
#> 7 4 3
#> 8 8 3
#> 9 8 5
#> 10 10 5
fortify(stepfun(c(1, 2, 3, 4, 5, 6, 7, 8, 10), c(4, 5, 6, 7, 8, 9, 10, 11, 12, 9)))
#> x y
#> 1 0 4
#> 2 1 4
#> 3 1 5
#> 4 2 5
#> 5 2 6
#> 6 3 6
#> 7 3 7
#> 8 4 7
#> 9 4 8
#> 10 5 8
#> 11 5 9
#> 12 6 9
#> 13 6 10
#> 14 7 10
#> 15 7 11
#> 16 8 11
#> 17 8 12
#> 18 10 12
#> 19 10 9
#> 20 11 9