Skip to content

Commit 95b7ba0

Browse files
committed
add stat to hline vline abline
1 parent 961b194 commit 95b7ba0

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

R/geom-abline.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ geom_abline <- function(mapping = NULL, data = NULL,
7373
slope,
7474
intercept,
7575
na.rm = FALSE,
76-
show.legend = NA) {
76+
show.legend = NA,
77+
stat = "identity",
78+
inherit.aes = FALSE) {
7779

7880
# If nothing set, default to y = x
7981
if (is.null(mapping) && missing(slope) && missing(intercept)) {
@@ -108,11 +110,11 @@ geom_abline <- function(mapping = NULL, data = NULL,
108110
layer(
109111
data = data,
110112
mapping = mapping,
111-
stat = StatIdentity,
113+
stat = stat,
112114
geom = GeomAbline,
113115
position = PositionIdentity,
114116
show.legend = show.legend,
115-
inherit.aes = FALSE,
117+
inherit.aes = inherit.aes,
116118
params = list2(
117119
na.rm = na.rm,
118120
...

R/geom-hline.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ geom_hline <- function(mapping = NULL, data = NULL,
88
...,
99
yintercept,
1010
na.rm = FALSE,
11-
show.legend = NA) {
11+
show.legend = NA,
12+
stat = "identity",
13+
inherit.aes = FALSE) {
1214

1315
# Act like an annotation
1416
if (!missing(yintercept)) {
@@ -28,11 +30,11 @@ geom_hline <- function(mapping = NULL, data = NULL,
2830
layer(
2931
data = data,
3032
mapping = mapping,
31-
stat = StatIdentity,
33+
stat = stat,
3234
geom = GeomHline,
3335
position = position,
3436
show.legend = show.legend,
35-
inherit.aes = FALSE,
37+
inherit.aes = inherit.aes,
3638
params = list2(
3739
na.rm = na.rm,
3840
...

R/geom-vline.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ geom_vline <- function(mapping = NULL, data = NULL,
88
...,
99
xintercept,
1010
na.rm = FALSE,
11-
show.legend = NA) {
11+
show.legend = NA,
12+
stat = "identity",
13+
inherit.aes = FALSE) {
1214

1315
# Act like an annotation
1416
if (!missing(xintercept)) {
@@ -28,11 +30,11 @@ geom_vline <- function(mapping = NULL, data = NULL,
2830
layer(
2931
data = data,
3032
mapping = mapping,
31-
stat = StatIdentity,
33+
stat = stat,
3234
geom = GeomVline,
3335
position = position,
3436
show.legend = show.legend,
35-
inherit.aes = FALSE,
37+
inherit.aes = inherit.aes,
3638
params = list2(
3739
na.rm = na.rm,
3840
...

0 commit comments

Comments
 (0)