This function generates a folder that serves as a database for ggfigdone.
fd_init(dir, recursive = TRUE, rm_exist = FALSE, set_default = TRUE, ...)
A character string specifying the directory path.
A logical value. If TRUE, the function will create the directory along with any necessary parent directories if they do not already exist. If FALSE, the function will create the directory only if its parent directory already exists.
A logical value. If TRUE, the function will remove the content in the directory if it already exists. If FALSE, the function will ask the user whether to remove the content in the directory.
A logical value. If TRUE, the function will set the database as the default database.
Additional arguments to be passed to fd_load
function.
An object of class fdObj
.
library(ggplot2)
## create ggfigdone database in a temporary directory
db_dir = file.path(tempdir(), "fd_init")
## Initate the ggfigdone database
fd_init(db_dir, rm_exist = TRUE)
#> The database version is up-to-date.
#> ##########
#> ## ggfigdone database: /var/folders/s6/160mpqjd6rl4lks63zb7f4900000gn/T//RtmpsqSsjk/fd_init
#> ## Number of figures: 0
#> ## Last updated date: 2024-12-26 16:12:14.516723