Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

How to split number series in equal size chunks and save in a list in r

$
0
0

I'm new to R. I am trying to separate a series of number into equal-sized chunks, for example, X <- 123456798123 it has 12 characters in it. Now I want to divide/split them into 6 character size chunks like [123456],[789123] and then save them into a list like separate elements like [1] "123456", [2] "789123", I want to do this for any length number which is divisible by 6. can anyone guide me to a function that can do this or other way. Thanks a lot.

Number is like 977787977970977972978076978676978831981132981883983671984264985265985806986064986346986909987749988622988959989165990746991001992535992747993482993506994293994873996102997740998210998458998781999295999464999529.


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>