Split a vector of items into buckets not exceeding some maximum bucket size. Useful for making fewer MediaWiki API calls when an endpoint accepts multiple page titles per call (for example).

wx_bucket_items(items, bucket_size)

Arguments

items

A vector of items

bucket_size

Maximum number of items a bucket may have

Value

A list with each element containing no more than bucket_size number of items. Flattening the returned list would yield the original items vector.