| Title: | Project Scaffolding for R and 'Quarto' |
|---|---|
| Description: | Creates structured R and 'Quarto' projects with a consistent directory layout: scripts in R/, analysis documents in analysis/, and web assets in www/. The primary entry point, init(), downloads the latest template from a companion 'GitHub' repository so that project structure evolves independently of package releases. Supports persistent author metadata and 'Quarto' brand configuration that carry across projects automatically. |
| Authors: | Kyle Grealis [aut, cre] (ORCID: <https://orcid.org/0000-0002-9223-8854>) |
| Maintainer: | Kyle Grealis <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.0.1 |
| Built: | 2026-05-15 09:44:35 UTC |
| Source: | https://github.com/kylegrealis/frogger |
Downloads the latest project scaffold from the frogger-templates repository and restores any saved user configuration. This is the recommended way to start a new froggeR project.
init(path = here::here())init(path = here::here())
path |
Character. Directory where the project will be created. If the
directory does not exist, it will be created. Default is current project
root via |
The function performs these steps:
Creates the target directory if it does not exist
Downloads the latest template zip from GitHub
Copies only files that do not already exist (never overwrites)
Restores saved user config (_variables.yml, _brand.yml,
logos/) from ~/.config/froggeR/ if present
Creates a data/ directory (gitignored by default)
Existing files are never overwritten. Each created and skipped file is reported individually so you can see exactly what changed.
Global configuration is saved via save_variables and
save_brand. If no saved config exists, the template defaults
are used as-is.
Invisibly returns the normalized path.
write_variables, write_brand,
save_variables, save_brand
## Not run: # Create a new project (directory is created automatically) init(path = file.path(tempdir(), "my-project")) ## End(Not run)## Not run: # Create a new project (directory is created automatically) init(path = file.path(tempdir(), "my-project")) ## End(Not run)
Deprecated. Use init() instead.
quarto_project(name, path = here::here(), example = TRUE)quarto_project(name, path = here::here(), example = TRUE)
name |
Character. Ignored. |
path |
Character. Ignored. |
example |
Logical. Ignored. |
Does not return. Always errors with a deprecation message.
## Not run: # Use init() instead init(path = "my-project") ## End(Not run)## Not run: # Use init() instead init(path = "my-project") ## End(Not run)
This function saves the current _brand.yml file from an existing froggeR
Quarto project to your global (system-wide) froggeR configuration. This allows
you to reuse brand settings across multiple projects.
save_brand(save_logos = TRUE)save_brand(save_logos = TRUE)
save_logos |
Logical. Should logo files from the |
This function:
Reads the project-level _brand.yml file
Saves it to your system-wide froggeR config directory
Optionally copies the logos directory for reuse in future projects
Prompts for confirmation if a global configuration already exists
The saved configuration is stored in rappdirs::user_config_dir('froggeR')
and will automatically be used in new froggeR projects created with
init or write_brand.
Invisibly returns NULL after saving configuration file.
# Save brand settings from current project to global config if (interactive()) save_brand() # Save brand settings but skip logos if (interactive()) save_brand(save_logos = FALSE)# Save brand settings from current project to global config if (interactive()) save_brand() # Save brand settings but skip logos if (interactive()) save_brand(save_logos = FALSE)
This function saves the current _variables.yml file from an existing froggeR
Quarto project to your global (system-wide) froggeR configuration. This allows
you to reuse metadata across multiple projects.
save_variables()save_variables()
This function:
Reads the project-level _variables.yml file
Saves it to your system-wide froggeR config directory
Prompts for confirmation if a global configuration already exists
The saved configuration is stored in rappdirs::user_config_dir('froggeR')
and will automatically be used in new froggeR projects created with
init or write_variables.
This is useful for maintaining consistent author metadata (name, email, affiliations, etc.) across all your projects without having to re-enter it each time.
Invisibly returns NULL after saving configuration file.
# Save metadata from current project to global config if (interactive()) save_variables()# Save metadata from current project to global config if (interactive()) save_variables()
Creates or opens a _brand.yml file in a Quarto project for editing.
If the file already exists, it is opened directly. If global froggeR brand
settings exist, those are used as the starting point. Otherwise, the template
is downloaded from the
frogger-templates
repository.
write_brand(path = here::here(), restore_logos = TRUE)write_brand(path = here::here(), restore_logos = TRUE)
path |
Character. Path to the project directory. Default is current project
root via |
restore_logos |
Logical. Restore logo content from system configuration.
Default is |
The _brand.yml file defines your visual identity for Quarto documents:
colors, logos, typography, and more. See the
brand.yml specification for
the full list of available options.
Use save_brand to persist your project-level brand configuration
to the global config directory for reuse across projects.
Invisibly returns the path to the file.
save_brand, write_variables,
init
## Not run: write_brand() ## End(Not run)## Not run: write_brand() ## End(Not run)
Creates or opens a .gitignore file in a Quarto project. If the file
already exists, it is opened directly. Otherwise, the opinionated template is
downloaded from the
frogger-templates
repository.
write_ignore(path = here::here())write_ignore(path = here::here())
path |
Character. Path to the project directory. Default is current project
root via |
Invisibly returns the path to the file.
## Not run: write_ignore() ## End(Not run)## Not run: write_ignore() ## End(Not run)
Downloads the Quarto template from the
frogger-templates
repository and writes it to the analysis/ directory. Errors if a file
with the same name already exists.
write_quarto(filename = "Untitled-1", path = here::here())write_quarto(filename = "Untitled-1", path = here::here())
filename |
Character. The name of the file without the |
path |
Character. Path to the project directory. Default is current project
root via |
The file is written to analysis/<filename>.qmd. The analysis/
directory is created automatically if it does not exist.
Invisibly returns the path to the created Quarto document.
init, write_variables,
write_brand
## Not run: # Create a Quarto document with the default name write_quarto() # Create a Quarto document with a custom name write_quarto(filename = "analysis") ## End(Not run)## Not run: # Create a Quarto document with the default name write_quarto() # Create a Quarto document with a custom name write_quarto(filename = "analysis") ## End(Not run)
Creates or opens an SCSS file in the www/ directory. If the file
already exists, it is opened directly. Otherwise, the template is
downloaded from the
frogger-templates
repository.
write_scss(filename = "custom", path = here::here())write_scss(filename = "custom", path = here::here())
filename |
Character. The name of the file without the |
path |
Character. Path to the project directory. Default is current
working directory via |
The file is written to www/<filename>.scss. The www/
directory is created automatically if it does not exist.
Invisibly returns the path to the file.
## Not run: # Create the default custom.scss write_scss() # Create a second SCSS file write_scss("custom2") # These are equivalent write_scss("www/custom2.scss") ## End(Not run)## Not run: # Create the default custom.scss write_scss() # Create a second SCSS file write_scss("custom2") # These are equivalent write_scss("www/custom2.scss") ## End(Not run)
Creates or opens a _variables.yml file in a Quarto project for editing.
If the file already exists, it is opened directly. If global froggeR settings
exist, those are used as the starting point. Otherwise, the template is
downloaded from the
frogger-templates
repository.
write_variables(path = here::here())write_variables(path = here::here())
path |
Character. Path to the project directory. Default is current project
root via |
The _variables.yml file stores reusable author metadata that Quarto
documents can reference. Available fields:
name: Your full name as it appears in publications
email: Contact email address
orcid: ORCID identifier (e.g., 0000-0001-2345-6789)
url: Personal website or profile URL
github: GitHub username
affiliations: Institution, department, etc.
Use save_variables to persist your project-level metadata to
the global config directory for reuse across projects.
Invisibly returns the path to the file.
save_variables, write_brand,
init
## Not run: write_variables() ## End(Not run)## Not run: write_variables() ## End(Not run)