Creating R Research Projects
This skill helps create and manage a complete R-based research analysis workflow. It is designed for scientific computing, statistical modeling, bioinformatics, and data visualization tasks.
Use this skill when the user wants to:
- - Analyze datasets using R
- Perform statistical tests or modeling
- Run bioinformatics or omics analysis in R
- Generate plots, figures, or reports
- Create a reproducible R project structure
- Install and manage R package dependencies
What This Skill Does
When activated, this skill will:
- 1. Create a structured R project
-
data/ for raw and processed data
-
scripts/ for analysis code
-
results/ for outputs
-
reports/ for R Markdown or Quarto reports
- 2. Set up environment
- Initialize
.Rproj (if using RStudio)
- Create
renv environment for reproducibility
- Install required CRAN/Bioconductor packages
- 3. Generate analysis scripts
- Data loading and cleaning
- Statistical analysis or modeling
- Visualization with
ggplot2
- Save outputs (CSV, plots, model summaries)
- 4. Create a report
- R Markdown / Quarto document
- Includes methods, results, and figures
- Render to HTML or PDF
Example User Requests That Should Trigger This Skill
- - "Use R to analyze this CSV and generate plots"
- "Run differential expression analysis in R"
- "Create a statistical report for this dataset"
- "Build an R project for microbiome analysis"
- "Fit a regression model in R and summarize results"
Example Workflow
User: Analyze this gene expression dataset and produce figures.
Skill actions:
- - Create project structure
- Install
tidyverse, DESeq2, INLINECODE9 - Write analysis script
- Generate PCA plot and volcano plot
- Produce an HTML report
Tools & Packages Commonly Used
| Purpose | R Packages |
|---|
| Data wrangling | tidyverse, data.table |
| Visualization |
ggplot2, patchwork |
| Statistics | stats, lme4, survival |
| Bioinformatics | Bioconductor packages (DESeq2, edgeR, limma) |
| Reporting | rmarkdown, quarto |
| Reproducibility | renv |
Notes
- - Prefer reproducible workflows (
renv, scripted analysis) - Avoid interactive-only steps unless requested
- All outputs should be saved to files, not just printed to console
创建R研究项目
该技能可帮助创建和管理完整的基于R的研究分析工作流程。它专为科学计算、统计建模、生物信息学和数据可视化任务而设计。
当用户希望以下操作时使用此技能:
- - 使用R分析数据集
- 执行统计检验或建模
- 在R中运行生物信息学或组学分析
- 生成图表、图形或报告
- 创建可重复的R项目结构
- 安装和管理R包依赖项
该技能的功能
激活后,该技能将:
- 1. 创建结构化的R项目
- data/ 用于原始和处理后的数据
- scripts/ 用于分析代码
- results/ 用于输出结果
- reports/ 用于R Markdown或Quarto报告
- 2. 设置环境
- 初始化 .Rproj(如果使用RStudio)
- 创建 renv 环境以确保可重复性
- 安装所需的CRAN/Bioconductor包
- 3. 生成分析脚本
- 数据加载和清洗
- 统计分析或建模
- 使用 ggplot2 进行可视化
- 保存输出(CSV、图表、模型摘要)
- 4. 创建报告
- R Markdown / Quarto文档
- 包含方法、结果和图表
- 渲染为HTML或PDF
应触发此技能的用户请求示例
- - 使用R分析这个CSV文件并生成图表
- 在R中运行差异表达分析
- 为这个数据集创建统计报告
- 构建用于微生物组分析的R项目
- 在R中拟合回归模型并总结结果
示例工作流程
用户: 分析这个基因表达数据集并生成图表。
技能操作:
- - 创建项目结构
- 安装 tidyverse、DESeq2、ggplot2
- 编写分析脚本
- 生成PCA图和火山图
- 生成HTML报告
常用工具与包
| 用途 | R包 |
|---|
| 数据整理 | tidyverse, data.table |
| 可视化 |
ggplot2, patchwork |
| 统计 | stats, lme4, survival |
| 生物信息学 | Bioconductor包 (DESeq2, edgeR, limma) |
| 报告 | rmarkdown, quarto |
| 可重复性 | renv |
注意事项
- - 优先使用可重复的工作流程(renv、脚本化分析)
- 除非用户要求,否则避免仅交互式步骤
- 所有输出应保存到文件,而不仅仅是打印到控制台