Skip to content
Back to skills

Future

ASecurity

R future package for parallel computing. Use for unified async and parallel evaluation.

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

Security analysis

A100/100

Scanned June 4, 2026

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

Installs into .claude/skills of the current project.

Are you the author of Future?

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

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

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: future
description: R future package for parallel computing. Use for unified async and parallel evaluation.
---

# future Package

Unified parallel and distributed processing.

## Setup

```r
library(future)

# Sequential (default)
plan(sequential)

# Multicore (fork, Unix only)
plan(multicore, workers = 4)

# Multisession (separate R sessions)
plan(multisession, workers = 4)

# Cluster
plan(cluster, workers = c("n1", "n2", "n3"))
```

## Basic Usage

```r
# Create future
f <- future({
  slow_computation(data)
})

# Get value (blocks until done)
result <- value(f)

# Check if resolved
resolved(f)
```

## Implicit Futures

```r
# %<-% operator
result %<-% {
  slow_computation(data)
}

# Use result (blocks if not ready)
print(result)
```

## future.apply

```r
library(future.apply)

# Parallel lapply
results <- future_lapply(1:100, function(i) {
  expensive_function(i)
})

# Parallel sapply
results <- future_sapply(1:100, expensive_function)

# Parallel mapply
results <- future_mapply(func, x, y)

# Parallel Map
results <- future_Map(func, x, y)
```

## Multiple Futures

```r
# Create multiple futures
futures <- lapply(data_list, function(d) {
  future({ process(d) })
})

# Collect all results
results <- lapply(futures, value)
```

## Error Handling

```r
f <- future({
  stop("Error!")
})

# Errors propagate on value()
tryCatch(
  value(f),
  error = function(e) message("Caught: ", e$message)
)
```

## Global Variables

```r
# Automatic detection
x <- 10
f <- future({ x + 1 })

# Explicit
f <- future({ x + 1 }, globals = list(x = 10))
```

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…