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
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
See also
Other custom:
%REM%()
,
contains_IM()
,
expit()
,
filter_IM()
,
indexof()
,
logistic()
,
logit()
,
mod()
,
rbool()
,
rdist()
,
rem()
,
round_IM()
,
shuffle()
,
substr_i()
Examples
length_IM(c("a", "b", "c")) # 3
#> [1] 3
length_IM("abcdef") # 6
#> [1] 6
length_IM(c("abcdef")) # 6
#> [1] 6