Learn R Programming

readr (version 1.3.1)

read_lines_chunked: Read lines from a file or string by chunk.

Description

Read lines from a file or string by chunk.

Usage

read_lines_chunked(file, callback, chunk_size = 10000, skip = 0,
  locale = default_locale(), na = character(),
  progress = show_progress())

read_lines_raw_chunked(file, callback, chunk_size = 10000, skip = 0, progress = show_progress())

Arguments

file

Either a path to a file, a connection, or literal data (either a single string or a raw vector).

Files ending in .gz, .bz2, .xz, or .zip will be automatically uncompressed. Files starting with http://, https://, ftp://, or ftps:// will be automatically downloaded. Remote gz files can also be automatically downloaded and decompressed.

Literal data is most useful for examples and tests. It must contain at least one new line to be recognised as data (instead of a path) or be a vector of greater than length 1.

Using a value of clipboard() will read from the system clipboard.

callback

A callback function to call on each chunk

chunk_size

The number of rows to include in each chunk

skip

Number of lines to skip before reading data.

locale

The locale controls defaults that vary from place to place. The default locale is US-centric (like R), but you can use locale() to create your own locale that controls things like the default time zone, encoding, decimal mark, big mark, and day/month names.

na

Character vector of strings to interpret as missing values. Set this option to character() to indicate no missing values.

progress

Display a progress bar? By default it will only display in an interactive session and not while knitting a document. The display is updated every 50,000 values and will only display if estimated reading time is 5 seconds or more. The automatic progress bar can be disabled by setting option readr.show_progress to FALSE.

See Also

Other chunked: callback, melt_delim_chunked, read_delim_chunked