[R] Special sequence

Sarah Goslee sarah.goslee at gmail.com
Mon Feb 29 23:43:14 CET 2016


> fourseq <- sprintf("%04d", 1:3000)
> head(fourseq)
[1] "0001" "0002" "0003" "0004" "0005" "0006"
> tail(fourseq)
[1] "2995" "2996" "2997" "2998" "2999" "3000"

Note that it has to be character to maintain the initial zeroes.

Sarah

On Mon, Feb 29, 2016 at 3:12 PM, Cacique Samurai
<caciquesamurai at gmail.com> wrote:
> Hello Helpers!
>
> How to create a number sequence from1 to 3000, but usigm four numbers
> like 0001, 0002...0102...3000.
>
> Thanks in advanced,
>
> Raoni
>



More information about the R-help mailing list