Skip to contents

Scaffolds the files and folders needed to produce OSM dashboards by copying the necessary structure from inst/templates/ located in this package.

Usage

create_dashboard(path)

Arguments

path

a string containing the destination path where the dashboard is going to reside.

Value

a folder containing the template to start editing the dashboard.

Examples

# Save the current working directory
original_wd <- getwd()

# Create a temporary directory
temp_dir <- tempdir()

# Set the working directory to the temporary directory
setwd(temp_dir)

# Run the scaffold_dashboard function to create the dashboard
create_dashboard("dashboard_folder")
#>  Dashboard scaffolded successfully at: /tmp/RtmpIrUgwY/dashboard_folder.

# Check the contents of the created dashboard folder
list.files("dashboard_folder", recursive = TRUE)
#> [1] "README.md"                     "dashboard.qmd"                
#> [3] "data/metadata/group_info.csv"  "data/metadata/group_users.csv"
#> [5] "data_retrieval.R"             

# Clean up: delete the created dashboard folder
unlink("dashboard_folder", recursive = TRUE)

# Restore the original working directory
setwd(original_wd)