loadCSV: Load CSV file

View source: R/watanabe-io.R

loadCSVR Documentation

Load CSV file

Description

Wrapper function around utils::read.csv() to load CSV (comma separated values) files into memory as data frames.

Usage

loadCSV(filePath, headers = TRUE, factorLabels = FALSE,
  encodingFile = "UTF-8", encoding = "UTF-8", ...)

Arguments

filePath

Path to CSV file to load into memory.

headers

Is the first row of the file column names?

factorLabels

Convert variables with values as a factors with those levels.

encodingFile

Encoding of the original file (UTF-8, macintosh, etc)

encoding

Marks imported strings as known to have a particular coding. Does not change the encoding itself, which will be automatically set to the encoding R is using on the local system. See 'Encoding.'

...

Additional arguments to pass to read.csv.

Value

A data frame with the contents of the CSV file.

Encoding

Encodings refer to the way that characters are stored in memory (or more specifically how R translates the zeros and ones in memory into characters). Unfortunately, there are many encoding systems. R will use one encoding, which at least on macs is UTF-8, but you may be reading data files from another. R will automatically convert data to its encoding system on import, but may need to know what those are. Use encodingFile to specify the encoding of the file you're importing from. Generally, you should not need to change encoding, unless R is using Laitn-1 (perhaps the standard for Windows) or a different encoding on your machine.


awatanabe/appr documentation built on Sept. 26, 2022, 8:04 a.m.