read.csv.multi: Read Multiple CSV's

Description Usage Arguments Value

View source: R/read.csv.multi.R

Description

Read all the csv's in a folder than have filenames matching a given pattern and return a single data.frame

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
read.csv.multi(
  folder,
  header = TRUE,
  sep = ",",
  quote = "\"",
  dec = ".",
  fill = TRUE,
  trim = TRUE,
  comment.char = "",
  stringsAsFactors = F,
  pattern = NULL,
  dupVar = NULL,
  orderBy = NULL,
  decreasing = T,
  idcol = NULL,
  messageLevel = 0
)

Arguments

folder

character of length 1 with the address of a folder

header

a logical value indicating whether the file contains the names of the variables as its first line. If missing, the value is determined from the file format: header is set to TRUE if and only if the first row contains one fewer field than the number of columns.

sep

the field separator character. Values on each line of the file are separated by this character. If sep = "" (the default for read.table) the separator is ‘white space’, that is one or more spaces, tabs, newlines or carriage returns.

quote

the set of quoting characters. To disable quoting altogether, use quote = "". Quoting is only considered for columns read as character, which is all of them unless colClasses is specified.

dec

the character used in the file for decimal points.

fill

logical. If TRUE then in case the rows have unequal length, blank fields are implicitly added. See ‘Details’.

trim

logical. Should excess columns be trimmed (TRUE) or should missing columns be filled with NA's (FALSE)

comment.char

a character vector of length one containing a single character or an empty string. Use "" to turn off the interpretation of comments altogether.

stringsAsFactors

Should strings be converted to factors? Default is FALSE. This should almost never be set to TRUE.

pattern

character string containing a regular expression to be matched to file names. Coerced by as.character to a character string if possible. If a character vector of length 2 or more is supplied, the first element is used with a warning.

dupVar

character of length 1 with the name of a variable for which duplicates should be dropped

orderBy

character of length 1 with the name of a variable by which to sort the result

decreasing

logical, should ordering be done by decreasing values?

idcol

Generates an index column. Default (NULL) is not to. If idcol=TRUE then the column is auto named .id. Alternatively the column name can be directly provided, e.g., idcol = "id". If input is a named list, ids are generated using them, else using integer vector from 1 to length of input list.

messageLevel

integer, the level of messages that should be printed to the console

Value

data.table


debarros/dbTools documentation built on Sept. 18, 2020, 10:51 a.m.