identical_structure: Check if two objects have identical structure

View source: R/identical_structure.R

identical_structureR Documentation

Check if two objects have identical structure

Description

This function determines whether two objects have the same structure,

  • which includes the mode, class and dimension

  • but does not include concrete values or attributes.

Usage

identical_structure(x, y)

Arguments

x, y

[any]
Two objects.

Value

Either TRUE if x and y have the same structure, and FALSE, else.

References

Inspired by https://stackoverflow.com/a/45548885/15157768.

See Also

Other package helpers: Dictionary, Storage, input_check_response(), match_arg(), package_logo(), print_data.frame(), print_matrix(), renv_development_packages(), system_information(), unexpected_error(), user_confirm()

Examples

identical_structure(integer(1), 1L)
identical_structure(diag(2), matrix(rnorm(4), 2, 2))
identical_structure(diag(2), data.frame(diag(2)))

oeli documentation built on Oct. 16, 2024, 5:08 p.m.