This function extracts the names of the datasets provided in the input files.
If specific data names are provided, they are used, otherwise the function tries
to extract the names from the files themselves.
Usage
name_data(files_data, data_names = NULL)
Arguments
- files_data
A vector of file paths or list of data frames.
- data_names
A vector of names to be assigned to datasets.
Value
A vector of dataset names.
Examples
name_data(files_data = c("path/to/data1.csv", "path/to/data2.csv"))
#> [1] "data1" "data2"
name_data(files_data = c("path/to/data.xlsx"), data_names = c("sheet1", "sheet2"))
#> [1] "sheet1" "sheet2"