View source: R/f - Write data to file merged.R
f_write_data_to_file_merged | R Documentation |
Reads, appends and writes data to merged file. Function looks for files with same core name in folder - usually only the date (and time) differs. The files can be filtered on their age (number of days). Only files older than n.day.max are merged and written to a new file. New data can be appended through df.input. The files that were merged are moved to an Archive\ folder.
f_write_data_to_file_merged(
df.input,
c.path,
c.file.string,
c.file.type,
c.sheet.name = "Sheet1",
v.add.date = TRUE,
v.add.time = FALSE,
n.day.max = 1e+06
)
df.input |
Data frame with data to append to merged data, |
c.path |
Path where file(s) are searched for. |
c.file.string |
Core of the filename of the files to be merged. The same is used for the file that is written. |
c.file.type |
File type of files to merge. The merged file will also be saved in this format. |
c.sheet.name |
Sheetname containing the data to be merged. Is relevant in case of c.file.type being xls (default: "Sheet1"). |
v.add.date , v.add.time |
Vector of booleans to specify whether data and/or time should be added. This should be as long as x (default: TRUE and FALSE, resp.). |
n.day.max |
Files newer than the number of days given in n.day.max are merged. The high default value essentially means that all files are merged (default: 1000000). |
-
Boolean whether the vector contains unique values.
Pieter Overdevest
f_write_data_to_file_merged(
df.input = mtcars,
c.path = path.data,
c.file.string = "dummy file",
c.sheet.name = "Sheet1",
c.file.type = "xls",
v.add.date = TRUE,
v.add.time = FALSE,
n.day.max = 1000000
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.