Skip to contents

Equivalent of .Length() in Insight Maker, which returns the number of elements when performed on a vector, but returns the number of characters when performed on a string

Usage

IM_length(x)

Arguments

x

A vector or a string

Value

The number of elements in x if x is a vector; the number of characters in x if x is a string

Examples

IM_length(c("a", "b", "c")) # 3
#> [1] 3
IM_length("abcdef") # 6
#> [1] 6
IM_length(c("abcdef")) # 6
#> [1] 6