Learn R Programming

tester (version 0.2.0)

same_type: Same Type

Description

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

Usage

same_type(x, y)

Arguments

x

an R object

y

an R object

Examples

Run this code
same_type(letters[1:3], "class") # TRUE
same_type(1:3, "class") # FALSE

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

Run the code above in your browser using DataLab