Skip to main content
23-Emerald V
September 22, 2015
Question

Function to convert a string into a vector of characters

  • September 22, 2015
  • 0 replies
  • 1195 views

A function to convert a string, or vector of character codes, into a vector of characters.

This is a function I have found useful on several occasions.  An example is counting successive sequences of characters in a string (eg, for run length encoding).   A recent Community task was to count sequences of numbers in a vector, for which the function seqcount was created.   Counting characters in a string can be done using char to convert a string to a vector of characters and then applying seqcount to that vector.

Stuart