peacock helps you quickly set up new R projects with pre-configured directory structures and files. Stop creating the same folders and files manually every time you start a project. Just run a function and get working.
When starting a new project, you probably find yourself:
- Creating the same folders over and over (data, scripts, outputs)
- Setting up Shiny apps with the same basic structure
- Writing boilerplate code for UI, server, and global files
- Manually organizing files for reproducible research
peacock automates this. It gives you clean, organized project templates so you can start coding immediately.
Install from GitHub:
# install.packages("devtools")
devtools::install_github("samuelbharti/peacock")Creates a complete Shiny app with organized folders and starter files.
library(peacock)
# Set up a new Shiny project
init_shiny(path = "my_shiny_app")This creates:
ui.R,server.R,global.R- Your main Shiny filesmodules/- For modular Shiny componentsuserInterface/- UI components organized separatelywww/- Static files (CSS, images, JavaScript)data/,R/,dev/- Standard project foldersDockerfile- Ready for containerization.gitignoreand.Renviron- Project configuration
Track project changes in a structured markdown file.
init_changelog_md(path = "my_project")Creates a CHANGELOG.md file with a simple format for documenting your work.
Pull down complete project templates from GitHub repositories.
# Initialize from a Shiny template
init_template("shiny", path = "my_project")
# Initialize from a CGDS research template
init_template("cgds", path = "research_project")The CGDS template is part of the UAB CGDS research workflow.
Organize projects that compare multiple tools or methods.
tool_review_template(
tool_name = c("tool1", "tool2", "tool3"),
tool_url = c("https://tool1.com", "https://tool2.com", "https://tool3.com"),
path = "tool_comparison"
)This creates organized folders for data, scripts, outputs, and documentation for each tool.
Once installed, peacock adds an RStudio Add-in for quick access:
- Find "Peacock: Shiny Template" in the Addins menu
- Or create a new project and select "Peacock: Shiny Template" from the templates
library(peacock)
# Create a new Shiny app in the current directory
init_shiny()
# Or specify a path
init_shiny(path = "path/to/new/project", confirm = FALSE)Set confirm = FALSE to skip the confirmation prompt (useful for scripting).
- Full documentation: http://www.samuelbharti.com/peacock/
- Vignette:
vignette("introduction") - Issues and feedback: https://github.com/samuelbharti/peacock/issues
GPL-3