powered by
This function determines whether two objects have the same structure,
which includes the mode, class and dimension
mode
class
but does not include concrete values or attributes.
identical_structure(x, y)
Either TRUE if x and y have the same structure, and FALSE, else.
TRUE
x
y
FALSE
Two objects.
Inspired by https://stackoverflow.com/a/45548885/15157768.
identical_structure(integer(1), 1L) identical_structure(diag(2), matrix(rnorm(4), 2, 2)) identical_structure(diag(2), data.frame(diag(2)))
Run the code above in your browser using DataLab