Learn R Programming

metacoder (version 0.3.7)

read_lines_apply: Apply a function to chunks of a file

Description

Reads a file in chunks, applies a function to each of them, and returns to results of the function calls.

Usage

read_lines_apply(
  file_path,
  func,
  buffer_size = 1000,
  simplify = FALSE,
  skip = 0
)

Value

list of results of func

Arguments

file_path

(character of length 1) The path to a file to read.

func

(function) The function to run on each chunk of the file.

buffer_size

(numeric of length 1) The number of lines in each chunk

simplify

(logical of length 1) If TRUE, then the result is simplified to a vector.

skip

(numeric of length 1) Where to start reading the file.