big_read: Read a file as FBM

Description Usage Arguments Value

View source: R/read-write.R

Description

Read a file as a Filebacked Big Matrix by using package bigreadr. For a mini-tutorial, please see this vignette.

Usage

1
2
3
4
5
6
7
8
big_read(
  file,
  select,
  filter = NULL,
  type = c("double", "float", "integer", "unsigned short", "unsigned char", "raw"),
  backingfile = drop_ext(file),
  ...
)

Arguments

file

File to read.

select

Indices of columns to read (sorted). The length of select will be the number of columns of the resulting FBM.

filter

Vector used to subset the rows of each data frame.

type

Type of the Filebacked Big Matrix (default is double). Either

  • "double" (double precision – 64 bits)

  • "float" (single precision – 32 bits)

  • "integer"

  • "unsigned short": can store integer values from 0 to 65535. It has vocation to become the basis for a FBM.code65536.

  • "raw" or "unsigned char": can store integer values from 0 to 255. It is the basis for class FBM.code256 in order to access 256 arbitrary different numeric values. It is used in package bigsnpr.

backingfile

Path to the file storing the FBM data on disk. An extension ".bk" will be automatically added. Default uses file without its extension.

...

Arguments passed on to bigreadr::big_fread2

nb_parts

Number of parts in which to split reading (and transforming). Parts are referring to blocks of selected columns. Default uses part_size to set a good value.

skip

Number of lines to skip at the beginning of file.

progress

Show progress? Default is FALSE.

part_size

Size of the parts if nb_parts is not supplied. Default is 500 * 1024^2 (500 MB).

Value

A Filebacked Big Matrix of type type with length(select) columns.


bigstatsr documentation built on April 5, 2021, 5:08 p.m.