alike(`&&`, function() NULL, vetr_settings(type.mode = 1))

`function() NULL` should be type "special" (is "closure")

[1] "`function() NULL` should be type \"special\" (is \"closure\")"

Argument `settings` is not a length 8 list as expected

Error in .alike(1, 2, NULL) : 
  Argument `settings` is not a length 8 list as expected

`1.1` should be type "integer-like" (is "double")

[1] "`1.1` should be type \"integer-like\" (is \"double\")"

# TRUE, by default, integers are always considered real

# FALSE, we do not check numerics for integerness if longer than 100

# Scalarness can now be checked at same time as type

`c(TRUE, TRUE)` should be length 1 (is 2)

[1] "`c(TRUE, TRUE)` should be length 1 (is 2)"

# Zero length match any length of same type

[1] "`integer()` should be length 10 (is 0)"

alike(list(integer(), list(character(), logical(1L))), list(1:10, 
    list(letters, TRUE)))

# Recursive objects compared recursively

alike(list(integer(), list(character(), logical(1L))), list(1:10, 
    list(letters, c(TRUE, FALSE))))

`list(1:10, list(letters, c(TRUE, FALSE)))[[2]][[2]]` should be length 1 (is 2)

[1] "`list(1:10, list(letters, c(TRUE, FALSE)))[[2]][[2]]` should be length 1 (is 2)"

# `NULL` is a wild card when nested within recursive objects

[1] "`mtcars` should be \"NULL\" (is \"list\")"

iris.fake <- transform(iris, Species = as.character(Species))

# Since `data.frame` are lists, we can compare them recursively:

`iris.fake$Species` should be class "factor" (is "character")

[1] "`iris.fake$Species` should be class \"factor\" (is \"character\")"

iris.fake2 <- transform(iris, Species = factor(Species, levels = `[[<-`(levels(Species), 
    3, "americana")))

# we even check attributes (factor levels must match)!

`levels(iris.fake2$Species)[3]` should be "virginica" (is "americana")

[1] "`levels(iris.fake2$Species)[3]` should be \"virginica\" (is \"americana\")"

# We can use partially specified objects as templates

'data.frame':	0 obs. of  5 variables:
 $ Sepal.Length: num 
 $ Sepal.Width : num 
 $ Petal.Length: num 
 $ Petal.Width : num 
 $ Species     : Factor w/ 3 levels "setosa","versicolor",..: