بنقرة واحدة
r-dev
R development packages. Use for package development, testing, documentation, code style, and IDE setup.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
R development packages. Use for package development, testing, documentation, code style, and IDE setup.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
R language data analysis and visualization skill. Use when user asks to (1) run R scripts or code, (2) install/update R packages, (3) perform data analysis with R, (4) create visualizations with ggplot2/plotly, (5) statistical analysis, (6) data manipulation with tidyverse/dplyr/data.table. Triggers on keywords like "R语言", "R脚本", "ggplot", "tidyverse", "数据分析", "可视化".
R DALEX package for model explanations. Use for explaining complex machine learning models.
R iml package for interpretable ML. Use for model-agnostic interpretability methods.
R lime package for local explanations. Use for explaining individual predictions with local interpretable models.
R packages for ML interpretability. Use for explaining and interpreting machine learning models.
R vip package for variable importance. Use for computing and visualizing variable importance scores.
| name | r-dev |
| description | R development packages. Use for package development, testing, documentation, code style, and IDE setup. |
| Sub-skill | Description |
|---|---|
| r-dev-package | devtools, usethis, roxygen2 |
| r-dev-testing | testthat, covr, mockery |
| r-dev-docs | pkgdown, vignettes, README |
| r-dev-oop | R6, S3, S4 classes |
R package development and tooling.
| Package | Description |
|---|---|
| devtools ★ | Package development tools |
| usethis ★ | Workflow automation |
| roxygen2 ★ | Documentation from comments |
| pkgdown | Package websites |
| testthat ★ | Unit testing |
| covr | Test coverage |
| Package | Description |
|---|---|
| lintr ★ | Static code analysis |
| styler | Code formatting |
| goodpractice | Package best practices |
| Package | Description |
|---|---|
| roxygen2 ★ | In-source documentation |
| sinew | Generate roxygen skeletons |
| staticdocs | Static HTML docs |
| Package | Description |
|---|---|
| R6 ★ | Encapsulated OOP |
| S7 | Next-gen OOP (experimental) |
| Package | Description |
|---|---|
| pryr | Understand R internals |
| lineprof | Line profiling |
| profvis | Interactive profiling |
| Package | Description |
|---|---|
| renv ★ | Project environments |
| box | Modern module system |
| import | Import mechanism |
| installr | Install software (Windows) |
| Package | Description |
|---|---|
| promises | Async programming |
| future | Parallel/distributed processing |
| Package | Description |
|---|---|
| Rocker | Docker configurations |
| drat | R repositories on GitHub |
| Tool | Description |
|---|---|
| RStudio ★ | Full-featured IDE |
| VSCode + vscode-R | VS Code support |
| radian | Modern R console |
| IRkernel | Jupyter kernel |
| Nvim-R | Neovim plugin |
# Create new package
usethis::create_package("mypackage")
# Add dependencies
usethis::use_package("dplyr")
usethis::use_pipe() # Add %>%
# Documentation
usethis::use_roxygen_md()
devtools::document()
# Testing
usethis::use_testthat()
usethis::use_test("myfunction")
devtools::test()
# Check package
devtools::check()
# Build and install
devtools::build()
devtools::install()
# roxygen2 documentation
#' Add two numbers
#'
#' @param x A number
#' @param y A number
#' @return The sum of x and y
#' @export
#' @examples
#' add(1, 2)
add <- function(x, y) {
x + y
}
# testthat tests
test_that("add works", {
expect_equal(add(1, 2), 3)
expect_equal(add(-1, 1), 0)
expect_error(add("a", 1))
})
# R6 class
library(R6)
Person <- R6Class("Person",
public = list(
name = NULL,
initialize = function(name) {
self$name <- name
},
greet = function() {
cat("Hello, I'm", self$name, "\n")
}
)
)
p <- Person$new("Alice")
p$greet()
# renv workflow
renv::init() # Initialize
renv::snapshot() # Save state
renv::restore() # Restore state
# Profiling
profvis::profvis({
# Code to profile
result <- slow_function(data)
})
# 1. Create package
usethis::create_package("mypackage")
# 2. Set up Git
usethis::use_git()
usethis::use_github()
# 3. Add license
usethis::use_mit_license()
# 4. Set up testing
usethis::use_testthat()
# 5. Add CI
usethis::use_github_action_check_standard()
# 6. Write code in R/
# 7. Document with roxygen2
devtools::document()
# 8. Write tests in tests/testthat/
devtools::test()
# 9. Check package
devtools::check()
# 10. Build pkgdown site
usethis::use_pkgdown()
pkgdown::build_site()