In order for an object to be considered a proper s3vec object, it has to

is_s3vec(x)

Arguments

x

An object to test.

Details

  • all child elements have to be of the same class

  • the "s3vec" class attribute has to be in last position

  • the remaining class attributes have to be the ones of the child elements

Examples

a <- structure("a", class = "foo") b <- structure("b", class = "foo") is_s3vec(s3vec(a, b)) # TRUE
#> [1] TRUE
is.s3vec(s3vec(a, b)) # TRUE
#> [1] TRUE
is_s3vec(a) # FALSE
#> [1] FALSE