loadCSV | R Documentation |
Wrapper function around utils::read.csv() to load CSV (comma separated values) files into memory as data frames.
loadCSV(filePath, headers = TRUE, factorLabels = FALSE, encodingFile = "UTF-8", encoding = "UTF-8", ...)
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 |
A data frame with the contents of the CSV file.
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.