In a file I’ve got there is for a list of parameters the following string set where a 0=false and a 1=true. I can create some simple script that cuts up the string in chars and then per char define set a vector with trues/falses but was wondering if there is no such functionality available by default in the base package or maybe a CRAN package.
Example bit string:
00000000000000000000100000001000000000000000000000000000000000000001
Strings can be long and I’ll have to parse loads of them so it would be great to see if there is some function that can do this with decent speed 🙂
If you can be assured that all the characters will be 0s or 1s, this should be fast: