Description Usage Arguments Value Errors Examples
Essentially this just reads any tab-separated value (tsv) file with headers
into a data frame. The file must be formatted correctly to read in, but no
other content is checked - that is the role of validateActions()
.
1 |
file |
The file to load. Must be a tab-separated file with headers.
Headers may be transformed by replacing spaces, etc. with |
Returns a data frame corresponding to the file read.
The following errors can occur:
No such file to load: "fileName" | The given file name can not be found. Try an absolute path or check permissions. |
Reading file "fileName" failed with the following error: |
There was an error reported by read.delim while reading
and parsing the specified tsv file.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # Create a temporary file to read in.
file.tsv <- tempfile()
file.create(file.tsv)
content <- c("col_a\tcol_b\tcol_c", "one\t1\tTRUE",
"two\t2\tFALSE", "# COMMENT")
writeLines( content, file.tsv )
# Read in a tsv file
if (file.exists(file.tsv)) {
df <- loadActions( file.tsv )
}
df
# Cleanup.
file.remove(file.tsv)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.