Description Usage Arguments Details Value
Combine all csv files in a given directory into a single data frame.
1 | combinecsv(myDir, addSource = TRUE, column1name = "Dummy_ID")
|
myDir |
A character scalar naming the directory in which the csv files are stored. Should end in a forward slash, e.g., "C:/temp/". All the csv files should have the same number of columns with the same header row of column names. |
addSource |
A logical scalar indicating whether a new column, named "source", should be added to the data frame identifying the source file, default TRUE. |
column1name |
A character scalar assigning a name to the first column in the data frame (writing over whatever name is there already), default "Dummy_ID". |
The column1name
argument is needed to handle occasional problems
with byte order marks at the beginning of the csv files, which can result
in strange characters being added to the name of the first column.
See, for example, this
link.
Any variable names starting with "X." and ending with a number are changed to ensure the number part of the name is rounded to the nearest whole number, e.g., "X.76.000000" is renamed "X.76".
A data frame with the information from all the csv files combined.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.