Last chance! 50% off unlimited learning
Sale ends in
StrChop(x, len, pos)
len
.len
and pos
can't be defined simultaneously, only alternatively.
Typical usages are
StrChop(x, len) StrChop(x, pos)
FixToTab
x <- paste(letters, collapse="")
StrChop(x=x, len = c(3,5,2))
# and with the rest integrated
StrChop(x=x, len = c(3, 5, 2, nchar(x)))
# cutpoints at 5th and 10th position
StrChop(x=x, pos=c(5, 10))
Run the code above in your browser using DataLab