file_merge {prepdat} | R Documentation |
Vertically Merge Files in a Directory into a Single Large Dataset
Description
Vertically concatenates files containing data tables in a long format into a single large dataset. In order for the function to work, all files you wish to merge should be in the same format (either txt or csv). This function is very useful for concatenating raw data files of individual subjects in an experiment (in which each line corresponds to a single observation in the experiment) to one raw data file that includes all subjects.
Usage
file_merge(
folder_path = NULL
, has_header = TRUE
, new_header = c()
, raw_file_name = NULL
, raw_file_extension = NULL
, file_name = "dataset.txt"
, save_table = TRUE
, dir_save_table = NULL
, notification = TRUE
)
Arguments
folder_path |
A string with the path of the folder in which files to be
merged are searched. Search is recursive (i.e., can search also in
subdirectories). |
has_header |
Logical. If |
new_header |
String vector with names for columns of the merged table.
Default is |
raw_file_name |
A string with the name of the files to be searched
and then merged. File extension should NOT be included here (see
|
raw_file_extension |
A string with the format of the files (i.e.,
|
file_name |
A string with the name of the file of the merged table the
function creates in case |
save_table |
Logical. If |
dir_save_table |
A string with the path of the folder in which the
merged table is saved in case |
notification |
Logical. If |
Value
The merged table