yyread: Easily read files

View source: R/read.R

yyreadR Documentation

Easily read files

Description

Function from data.table, readxl.

Usage

yyread(
  filename,
  rownames = FALSE,
  header = TRUE,
  method = c("vroom", "fread", "excel"),
  sheet = NULL,
  col_types = NULL,
  encoding = "unknown",
  ...
)

Arguments

filename

filename

rownames

Logical; whether to use the first column as the row names.

header

Logical; whether to use the first row as the col names.

method

c("vroom", "fread", "excel"). The function used to read the file, the default is "vroom". It is strongly recommended to use TSV or CSV files rather than Excel files

sheet

Excel option; either a string (the name of a sheet), or an integer (the position of the sheet).

col_types

Excel option; NULL to guess; A character vector containing these options: "skip", "guess", "logical", "numeric", "date", "text" or "list". If exactly one col_type is specified, it will be recycled. The content of a cell in a skipped column is never read

encoding

Default is "unknown". Other possible options are "UTF-8" and "Latin-1". and that column will not appear in the data frame output.

...

Others params from vroom::vroom(), data.table::fread() or readxl::read_excel(). Just like "num_threads" in vroom; "nThread" in data.table.

Examples

## Not run: 
yyread("a1.tsv")
yyread("a1.xls", method = "excel")

## End(Not run)

yanpd01/yyeasy documentation built on Dec. 1, 2022, 10:58 p.m.