Skip to content
Back to skills

R Dev

ASecurity

R development packages. Use for package development, testing, documentation, code style, and IDE setup.

  • 5 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added June 4, 2026
datagodockertestingdebugginggitdocumentation

Works with

  • vscode

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned June 4, 2026

npx -y skills add LeoLin990405/r-analytics-skill --skill r-dev --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of R Dev?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for R Dev
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/leolin990405-r-dev/badge)](https://www.skillsdirectory.com/skills/leolin990405-r-dev)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: r-dev
description: R development packages. Use for package development, testing, documentation, code style, and IDE setup.
---

# R Development Skill

## Sub-skills

| Sub-skill | Description |
|-----------|-------------|
| [r-dev-package](r-dev-package/SKILL.md) | devtools, usethis, roxygen2 |
| [r-dev-testing](r-dev-testing/SKILL.md) | testthat, covr, mockery |
| [r-dev-docs](r-dev-docs/SKILL.md) | pkgdown, vignettes, README |
| [r-dev-oop](r-dev-oop/SKILL.md) | R6, S3, S4 classes |

R package development and tooling.

## Package Development

| Package | Description |
|---------|-------------|
| **devtools** ★ | Package development tools |
| **usethis** ★ | Workflow automation |
| **roxygen2** ★ | Documentation from comments |
| **pkgdown** | Package websites |
| **testthat** ★ | Unit testing |
| **covr** | Test coverage |

## Code Quality

| Package | Description |
|---------|-------------|
| **lintr** ★ | Static code analysis |
| **styler** | Code formatting |
| **goodpractice** | Package best practices |

## Documentation

| Package | Description |
|---------|-------------|
| **roxygen2** ★ | In-source documentation |
| **sinew** | Generate roxygen skeletons |
| **staticdocs** | Static HTML docs |

## OOP Systems

| Package | Description |
|---------|-------------|
| **R6** ★ | Encapsulated OOP |
| **S7** | Next-gen OOP (experimental) |

## Debugging & Profiling

| Package | Description |
|---------|-------------|
| **pryr** | Understand R internals |
| **lineprof** | Line profiling |
| **profvis** | Interactive profiling |

## Environment & Reproducibility

| Package | Description |
|---------|-------------|
| **renv** ★ | Project environments |
| **box** | Modern module system |
| **import** | Import mechanism |
| **installr** | Install software (Windows) |

## Async & Promises

| Package | Description |
|---------|-------------|
| **promises** | Async programming |
| **future** | Parallel/distributed processing |

## Deployment

| Package | Description |
|---------|-------------|
| **Rocker** | Docker configurations |
| **drat** | R repositories on GitHub |

## IDEs & Editors

| Tool | Description |
|------|-------------|
| **RStudio** ★ | Full-featured IDE |
| **VSCode + vscode-R** | VS Code support |
| **radian** | Modern R console |
| **IRkernel** | Jupyter kernel |
| **Nvim-R** | Neovim plugin |

## Quick Examples

```r
# 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)
})
```

## Package Development Workflow

```r
# 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()
```

## Resources

- R Packages book: https://r-pkgs.org/
- devtools: https://devtools.r-lib.org/
- testthat: https://testthat.r-lib.org/
- roxygen2: https://roxygen2.r-lib.org/
- R6: https://r6.r-lib.org/

Files in this skill

  • SKILL.md4.2 KB
  • r-dev-docs/SKILL.md2 KB
  • r-dev-oop/R6/SKILL.md1.8 KB
  • r-dev-oop/SKILL.md2.5 KB
  • r-dev-package/SKILL.md1.7 KB
  • r-dev-package/box/SKILL.md3.3 KB
  • r-dev-package/covr/SKILL.md1.7 KB
  • r-dev-package/devtools/SKILL.md1.9 KB
  • r-dev-package/lintr/SKILL.md3.5 KB
  • r-dev-package/pkgdown/SKILL.md1.4 KB
  • r-dev-package/pryr/SKILL.md2.4 KB
  • r-dev-package/rcmdcheck/SKILL.md1.5 KB
  • r-dev-package/renv/SKILL.md3.1 KB
  • r-dev-package/roxygen2/SKILL.md1.5 KB
  • r-dev-package/styler/SKILL.md3.3 KB
  • r-dev-package/testthat/SKILL.md2.2 KB
  • r-dev-package/usethis/SKILL.md1.4 KB
  • r-dev-profiling/SKILL.md414 B
  • r-dev-profiling/bench/SKILL.md1.7 KB
  • r-dev-profiling/lobstr/SKILL.md1.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.