Initialize a new R data science project with best practices. This command uses the **r-data-architect** agent to create a well-structured, reproducible project foundation.
Initializes a new R data science project with best practices and reproducible structure.
/plugin marketplace add choxos/BiostatAgent/plugin install choxos-r-tidy-modeling-plugins-r-tidy-modeling@choxos/BiostatAgentInitialize a new R data science project with best practices. This command uses the r-data-architect agent to create a well-structured, reproducible project foundation.
project_name/
├── R/ # R functions
│ └── utils.R
├── data/
│ ├── raw/ # Original, immutable data
│ └── processed/ # Cleaned data
├── output/
│ ├── figures/ # Plots and visualizations
│ ├── tables/ # Summary tables
│ └── models/ # Saved model objects
├── reports/ # Quarto/RMarkdown reports
│ └── analysis.qmd
├── tests/ # testthat tests
│ └── testthat/
├── _targets.R # targets pipeline (optional)
├── .gitignore # Git ignore patterns
├── .Rprofile # Project-specific settings
├── renv.lock # Dependency lock file
├── project_name.Rproj # RStudio project
├── README.md # Project documentation
└── DESCRIPTION # Project metadata
/r-project-setup [project_name] [template] [options]
project_name: Name for the new projecttemplate: One of analysis, package, shiny, clinical (default: analysis)options: Comma-separated options (see below)analysis: Standard data analysis project
package: R package development
shiny: Shiny application
clinical: Clinical trial analysis
renv: Initialize renv for dependency management (default: yes)targets: Set up targets pipeline (default: yes for analysis)git: Initialize git repository (default: yes)github: Create GitHub repo structure (default: yes)docker: Include Dockerfile (default: no)ci: Include CI/CD workflows (default: yes)/r-project-setup customer_churn analysis renv,targets,git
This creates an analysis project called "customer_churn" with renv, targets, and git.
README.md
# Project Name
## Overview
Brief description of the project.
## Setup
Instructions for setting up the environment.
## Usage
How to run the analysis.
## Structure
Description of project organization.
DESCRIPTION
Type: project
Package: project_name
Title: Project Title
Version: 0.1.0
Authors@R: person("Name", "email@example.com", role = c("aut", "cre"))
Description: Project description.
License: MIT
R/utils.R
_targets.R (if targets enabled)
library(targets)
tar_option_set(
packages = c("tidyverse", "tidymodels"),
format = "qs"
)
list(
tar_target(raw_data, read_data("data/raw/data.csv")),
tar_target(clean_data, clean_data(raw_data)),
tar_target(model, fit_model(clean_data)),
tar_target(report, render_report(model))
)
.Rprofile
source("renv/activate.R")
options(
tidyverse.quiet = TRUE,
scipen = 999
)
.github/workflows/check.yml
.github/workflows/targets.yml
Standard analysis project includes:
After creation, the following manual steps are recommended:
renv::install("package")