Skip to contents

setup_filesystem creates the necessary folder structure and optionally clears old reports. This is a convenience function that combines create_filesystem and clear_old_reports.

Usage

setup_filesystem(folders, clear.reports = FALSE)

Arguments

folders

List. Contains paths to report folders with elements:

  • internal: Folder for internal reports

  • public: Folder for public reports

  • settings: Folder for settings files

clear.reports

Logical. Whether to clear old reports from the internal and public folders. Defaults to FALSE.

Value

The input folders list, unchanged.

Examples

# Create folders in a temporary directory
folders <- list(
  internal = file.path(tempdir(), "internal"),
  public = file.path(tempdir(), "public"),
  settings = file.path(tempdir(), "settings")
)
setup_filesystem(folders)
#> $internal
#> [1] "/tmp/RtmpT5sfiO/internal"
#> 
#> $public
#> [1] "/tmp/RtmpT5sfiO/public"
#> 
#> $settings
#> [1] "/tmp/RtmpT5sfiO/settings"
#>