Description Usage Arguments Value Examples
View source: R/file_database.R
Add File Information From File Database
1 |
data |
data frame with column |
data frame data
with additional columns folder_path
and file_name
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # Define some paths
paths <- c(
"/very/long/path/very_long_file_name_1",
"/very/long/path/very_long_file_name_2",
"/very/long/path/very_long_file_name_3"
)
# Create a "file database" from the paths
file_db <- kwb.file::to_file_database(paths, remove_common_base = FALSE)
# Create a data frame that relates some information to the files.
# Use the file identifier instead of the full name to keep the data clean
(df <- kwb.utils::noFactorDataFrame(
file_id = file_db$files$file_id,
value = seq_along(paths)
))
# Store the file database in the attribute "file_db"
df <- structure(df, file_db = file_db)
# Restore the full file paths
add_file_info(df)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.