fortify.stepfun: Convert 'stats::stepfun' to 'data.frame'

Description Usage Arguments Value Examples

View source: R/fortify_stats.R

Description

Convert stats::stepfun to data.frame

Usage

1
2
## S3 method for class 'stepfun'
fortify(model, data, ...)

Arguments

model

stats::stepfun instance

data

original dataset, if needed

...

other arguments passed to methods

Value

data.frame

Examples

1
2
3
4
fortify(stepfun(c(1, 2, 3), c(4, 5, 6, 7)))
fortify(stepfun(c(1), c(4, 5)))
fortify(stepfun(c(1, 3, 4, 8), c(4, 5, 2, 3, 5)))
fortify(stepfun(c(1, 2, 3, 4, 5, 6, 7, 8, 10), c(4, 5, 6, 7, 8, 9, 10, 11, 12, 9)))

Example output

Loading required package: ggplot2
  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
       x y
1 0.9375 4
2 1.0000 4
3 1.0000 5
4 1.0625 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
    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

ggfortify documentation built on April 19, 2018, 1:03 a.m.