Learn R Programming

calACS (version 2.2.2)

longestVec: The function takes in multiple vectors of any length, and returns the one with the longest length. The tieBreaker variable controls if the first or the last of the longest vectors gets returned in case there are multiple

Description

The function takes in multiple vectors of any length, and returns the one with the longest length. The tieBreaker variable controls if the first or the last of the longest vectors gets returned in case there are multiple

Usage

longestVec(..., tieBreaker = "last")

Arguments

...
vectors of any length
tieBreaker
decides if the first or the last longest vector gets returned if there are multiple longest vectors. Can be either 'first' or 'last'. Default to 'last'.

Examples

Run this code
longestVec(1:5, c('a','b'))

Run the code above in your browser using DataLab