Skip to content

Commit 7a995ea

Browse files
committed
fix unary Ops methods: -, +, !
1 parent cfcc115 commit 7a995ea

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

R/method-ops.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ on_load_define_ops <- function() {
1717
#' @export
1818
Ops.S7_object <- function(e1, e2) {
1919
cnd <- tryCatch(
20-
return(base_ops[[.Generic]](e1, e2)),
20+
return(
21+
if (missing(e2))
22+
base_ops[[.Generic]](e1)
23+
else
24+
base_ops[[.Generic]](e1, e2)
25+
),
2126
S7_error_method_not_found = function(cnd) cnd
2227
)
2328

0 commit comments

Comments
 (0)