read: read

View source: R/misc.r

readR Documentation

read

Description

automagically read tables to data.frame or data.table (default). Can read textfiles (csv) and compressed textfiles (bz2, xz, gzip) (using data.table::fread) Can read fst-files (package fst), qs-files (package qs) and Rds. Can also read xlsx-workbooks (using openxlsx::read.xlsx). Will read directly from http(s), ftp. Download and decompression is done via pipes, not temporary files (except for xlsx-workbooks).

Usage

read(input, data.table = T, ...)

Arguments

input

Filename to read. May start with 'http:/', 'https://' or 'ftp://'. For local files, wildcard-expansion (globbing) is done (See Sys.glob) If the file is a (compressed) textfile it will be downloaded, decompressed and read on-the-fly without using tempfiles. If it's an xlsx-workbook, it will be downloaded to a tempfile, then read.

data.table

set to TRUE to return a data.table instead of data.frame


inkeso/miscfun documentation built on Feb. 3, 2025, 5:33 p.m.