combineFiles | R Documentation |
Combine several textfiles into one, regardless of their content.
combineFiles(
inFiles = dir(),
outFile = "combined_Textfiles.txt",
overwrite = FALSE,
sep = NULL,
names = TRUE,
selection = NULL,
progbar = !quiet,
quiet = FALSE,
...
)
inFiles |
vector with names of input files, as can be read with
|
outFile |
Character string: name of the file to be created. Passed to
|
overwrite |
Logical: overwrite outFile? DEFAULT: FALSE |
sep |
Character string: Separation between content of each file and the following. DEFAULT: NULL, with which it uses an empty line, two lines with dashes, and another line break. |
names |
Should File names be included after sep? DEFAULT: TRUE |
selection |
Index of rows that should be written. Can refer to each file
separately, e.g. |
progbar |
Should a progress bar be drawn? Useful if you combine many large files. DEFAULT: !quiet, i.e. TRUE |
quiet |
Suppress message about number of files combined? DEFAULT: FALSE |
... |
Arguments passed to |
Final output file, invisibly.
Berry Boessenkool, berry-b@gmx.de, Nov 2012, Dec 2014, Jul 2015
compareFiles
, and the functions used internally here, namely:
paste
, scan
, write
.
## These are skipped by rcmd check (writing to external places is not allowed)
## Not run:
cat("This is Sparta.\nKicking your face.", file="BujakashaBerry1.txt")
cat("Chuck Norris will roundhousekick you.", file="BujakashaBerry2.txt")
combineFiles(inFiles=paste0("BujakashaBerry", 1:2, ".txt"),
outFile="BujakashaBerry3.txt")
file.show("BujakashaBerry3.txt")
unlink(paste0("BujakashaBerry", 1:3, ".txt"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.