File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 33
33
! identical(class(tryCatch(y [0L ], error = identity )), class(y )))
34
34
}
35
35
36
+ # # <NOTE>
37
+ # # We tend to not add internal utility functions to base as these cannot
38
+ # # really be hidden. Otherwise, we could do something like
39
+ # # .is_vector_like <- function(x) {
40
+ # # (length(dim(x)) < 2L) &&
41
+ # # identical(class(tryCatch(x[0L], error = identity)),
42
+ # # class(x))
43
+ # # }
44
+ # # (or perhaps even add a .is_vector_like() generic with the above as
45
+ # # default method, and
46
+ # # .is_same_kind <- function(x, y) {
47
+ # # isa(x, class(y)) || isa(y, class(x)
48
+ # # }
49
+ # # and finally
50
+ # # .set_ops_need_as_vector <- function(x, y) {
51
+ # # !.is_vector_like(x) ||
52
+ # # !.is_vector_like(y) ||
53
+ # # !.is_same_kind(x, y)
54
+ # # }
55
+ # # instead of putting everything into one function.
56
+ # # </NOTE>
57
+
36
58
union <-
37
59
function (x , y )
38
60
{
You can’t perform that action at this time.
0 commit comments