Learn R Programming

LaF (version 0.8.4)

next_block: Read the next block of data from a file.

Description

Read the next block of data from a file.

Usage

next_block(x, ...)

# S4 method for laf next_block(x, columns = 1:ncol(x), nrows = 5000, ...)

# S4 method for laf_column next_block(x, nrows = 5000, ...)

Arguments

x

an object the supports the next_block method, such as an laf object.

...

passed to other methods.

Reads the next block of lines from a file. The method returns a data.frame. The first line in the data.frame is the line corresponding to the current line in the file. When the end of the file is reached a data.frame with zero rows is returned. This can be used to check whether the end of the file is reached.

columns

an integer vector with the columns that should be read in.

nrows

the (maximum) number of rows to read in one block