loop_ind_f {flowGraph} | R Documentation

## Prepares parallel loop indices.

### Description

`loop_ind_f` is a helper function that splits a vector of loop indices into a list of multiple loop indices for use in parallel processes within the flowGraph package.

### Usage

    loop_ind_f(x, n)

### Arguments

`x` | A vector of loop indices.
`n` | An integer, or the number of vectors to split `x` into.

### Value

list of `n` vectors with elements from `x`.

### Examples

     old_loop_inds <- 1:10
     no_cores <- 5

     new_loop_inds <- flowGraph:::loop_ind_f(old_loop_inds, no_cores)
     # future::plan(future::multiprocess)
     # example_indices <- furrr::future_map(new_loop_inds, function(ii) {
     #     purrr::map(ii, function(i) i )
     # s})

[Package flowGraph version 1.2.0 Index]