doChunks: Execute a function in chunks.

View source: R/wiki_utils.R

doChunksR Documentation

Execute a function in chunks.

Description

Execute the function f(x,...) in chunks of chunk-size elements each. Wikidata and Wikimedia API have limits to execute a query. Wikidata has timeout limits, Wikimedia about the number of titles or pageIds. This function executes sequentially the function f over chunks of elements to prevent errors.

Usage

doChunks(f, x, chunksize, ...)

Arguments

f

The function to execute.

x

Vector of entities or titles/pageids.

chunksize

The number of elements in x to execute the function.

...

The f arguments.

Value

The results of execute f using all values of x

Author(s)

Angel Zazo, Department of Computer Science and Automatics, University of Salamanca


wikiTools documentation built on April 3, 2025, 9:38 p.m.