Learn R Programming

tester (version 0.2.0)

same_length: Same Length

Description

same_length() tests if two objects have same length
different_length() tests if two objects have different length

Usage

same_length(x, y)

Arguments

x

a matrix

y

a matrix

Examples

Run this code
same_length(1:10, letters[11:20]) # TRUE
same_length(1:10, letters[11:19]) # FALSE

a = matrix(1:15, 5, 3)
same_length(a, a) # TRUE
same_length(a, t(a)) # TRUE

different_length(t(a), a) # FALSE
different_length(1:10, a) # TRUE
different_length(a, "a") # TRUE

Run the code above in your browser using DataLab