same_type: Same Type

Description Usage Arguments Examples

Description

same_type() tests if two objects have the same type
different_type() tests if two objects have different type

Usage

1
  same_type(x, y)

Arguments

x

an R object

y

an R object

Examples

1
2
3
4
5
same_type(letters[1:3], "class") # TRUE
same_type(1:3, "class") # FALSE

different_type(1, 1L) # TRUE
different_type(1, 1.0) # FALSE


Search within the tester package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.