Learn R Programming

bread (version 0.4.1)

bcolnames: Retrieve the column names directly from a big file without loading it in memory

Description

Simply reads the first line of a file with data.table::fread and the head Unix command. This allows analyzing big files that would not fit in memory (and cause an error such as 'cannot allocate vector of size').

Usage

bcolnames(file = NULL, ...)

Value

A character vector

Arguments

file

String. Name or full path to a file compatible with data.table::fread()

...

Arguments that must be passed to data.table::fread() like 'sep'.

Examples

Run this code
file <- system.file('extdata', 'test.csv', package = 'bread')
## Retrieving the column names
bcolnames(file = file)

Run the code above in your browser using DataLab