Learn R Programming

multiplyr (version 0.1.1)

distribute: Calculations for how to distribute x items over N nodes

Description

This function is used to determine how to distribute the contents of a data frame across the cluster. It may either be called with a single number representing the total number of rows, or it may be called with a vector of numbers representing the size of groups.

Usage

distribute(x, N)

Arguments

x
Number of items or a vector of group sizes
N
Number of nodes

Value

A vector containing number of rows or a list containing the indices of groups

See Also

Other utility functions: between, cumall, cumany, cummean, first, lag, last, lead, n_distinct, n_groups, nth, n

Examples

Run this code
distribute (100, 4)
distribute (c(25, 25, 50), 2)

Run the code above in your browser using DataLab