Calls chunks() to create a sequence of range indexes along the object which causes the method dispatch.

chunk(x = NULL, ...)

# Default S3 method
chunk(x = NULL, ..., RECORDBYTES = NULL, BATCHBYTES = NULL)

Arguments

x

the object along we want chunks

...

further arguments passed to chunks()

RECORDBYTES

integer scalar representing the bytes needed to process a single element of the boolean vector (default 4 bytes for logical)

BATCHBYTES

integer scalar limiting the number of bytes to be processed in one chunk, default from getOption("ffbatchbytes") if not null, otherwise 16777216

Value

returns a named list of ri() objects representing chunks of subscripts

Details

chunk is generic, the default method is described here, other methods that automatically consider RAM needs are provided with package 'ff', see for example ff::chunk.ffdf()

Methods (by class)

  • chunk(default): default vector method

available methods

chunk.default, ff::chunk.ff_vector(), ff::chunk.ffdf()

See also

Author

Jens Oehlschlägel

Examples

  chunk(complex(1e7))
#> $`1:1000000`
#> range index (ri) from 1 to 1000000 maxindex 10000000 
#> 
#> $`1000001:2000000`
#> range index (ri) from 1000001 to 2000000 maxindex 10000000 
#> 
#> $`2000001:3000000`
#> range index (ri) from 2000001 to 3000000 maxindex 10000000 
#> 
#> $`3000001:4000000`
#> range index (ri) from 3000001 to 4000000 maxindex 10000000 
#> 
#> $`4000001:5000000`
#> range index (ri) from 4000001 to 5000000 maxindex 10000000 
#> 
#> $`5000001:6000000`
#> range index (ri) from 5000001 to 6000000 maxindex 10000000 
#> 
#> $`6000001:7000000`
#> range index (ri) from 6000001 to 7000000 maxindex 10000000 
#> 
#> $`7000001:8000000`
#> range index (ri) from 7000001 to 8000000 maxindex 10000000 
#> 
#> $`8000001:9000000`
#> range index (ri) from 8000001 to 9000000 maxindex 10000000 
#> 
#> $`9000001:10000000`
#> range index (ri) from 9000001 to 10000000 maxindex 10000000 
#> 
  chunk(raw(1e7))
#> $`1:10000000`
#> range index (ri) from 1 to 10000000 maxindex 10000000 
#> 
  chunk(raw(1e7), length=3)
#> $`1:2500000`
#> range index (ri) from 1 to 2500000 maxindex 10000000 
#> 
#> $`2500001:5000000`
#> range index (ri) from 2500001 to 5000000 maxindex 10000000 
#> 
#> $`5000001:10000000`
#> range index (ri) from 5000001 to 10000000 maxindex 10000000 
#> 

  chunks(1, 10, 3)
#> $`1:3`
#> range index (ri) from 1 to 3 maxindex NA 
#> 
#> $`4:6`
#> range index (ri) from 4 to 6 maxindex NA 
#> 
#> $`7:9`
#> range index (ri) from 7 to 9 maxindex NA 
#> 
#> $`10:10`
#> range index (ri) from 10 to 10 maxindex NA 
#> 
  # no longer do
  chunk(1, 100, 10)
#> $`1:1`
#> range index (ri) from 1 to 1 maxindex 1 
#> 
  # but for bckward compatibility this works
  chunk(from=1, to=100, by=10)
#> $`1:10`
#> range index (ri) from 1 to 10 maxindex NA 
#> 
#> $`11:20`
#> range index (ri) from 11 to 20 maxindex NA 
#> 
#> $`21:30`
#> range index (ri) from 21 to 30 maxindex NA 
#> 
#> $`31:40`
#> range index (ri) from 31 to 40 maxindex NA 
#> 
#> $`41:50`
#> range index (ri) from 41 to 50 maxindex NA 
#> 
#> $`51:60`
#> range index (ri) from 51 to 60 maxindex NA 
#> 
#> $`61:70`
#> range index (ri) from 61 to 70 maxindex NA 
#> 
#> $`71:80`
#> range index (ri) from 71 to 80 maxindex NA 
#> 
#> $`81:90`
#> range index (ri) from 81 to 90 maxindex NA 
#> 
#> $`91:100`
#> range index (ri) from 91 to 100 maxindex NA 
#>