The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
When running long computations in R, the most frustrating experience is:
Processing 10,000 API requests...
[Completed 9847/10000]
❌ Error: Connection timeout
❌ 3 hours of work lost
❌ Must restart from scratch
SafeMapper solves this problem — it provides
drop-in replacements for purrr and
furrr functions with automatic checkpointing and
recovery.
Load the package:
# SafeMapper: automatically saves progress
result <- s_map(1:20, function(x) {
Sys.sleep(0.01) # Simulate slow operation
x^2
})
#> [5%] Processing items 1-20 of 20
#> Completed 20 items
# View results
head(unlist(result), 10)
#> [1] 1 4 9 16 25 36 49 64 81 100That’s it! Just replace map() with
s_map(), and your code gains fault tolerance.
# Return character vector
char_result <- s_map_chr(c("a", "b", "c"), toupper)
#> [33%] Processing items 1-3 of 3
#> Completed 3 items
print(char_result)
#> [1] "A" "B" "C"
# Return numeric vector
num_result <- s_map_dbl(1:5, ~ .x^2)
#> [20%] Processing items 1-5 of 5
#> Completed 5 items
print(num_result)
#> [1] 1 4 9 16 25
# Return logical vector
lgl_result <- s_map_lgl(1:5, ~ .x > 3)
#> [20%] Processing items 1-5 of 5
#> Completed 5 items
print(lgl_result)
#> [1] FALSE FALSE FALSE TRUE TRUE| purrr/furrr | SafeMapper | Description |
|---|---|---|
map() |
s_map() |
Returns list |
map_chr() |
s_map_chr() |
Returns character vector |
map_dbl() |
s_map_dbl() |
Returns numeric vector |
map_int() |
s_map_int() |
Returns integer vector |
map_lgl() |
s_map_lgl() |
Returns logical vector |
map_dfr() |
s_map_dfr() |
Returns row-bound data frame |
map2() |
s_map2() |
Dual-input mapping |
pmap() |
s_pmap() |
Multi-input mapping |
walk() |
s_walk() |
Side effects only |
future_map() |
s_future_map() |
Parallel mapping |
┌──────────────────────────────────────────────────────────────────┐
│ SafeMapper Workflow │
├──────────────────────────────────────────────────────────────────┤
│ │
│ Input Data ──► Generate ──► Checkpoint ──► Yes ──► Resume from │
│ Fingerprint Exists? Checkpoint │
│ │ │
│ ▼ No │
│ Start Fresh │
│ │ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ Batch Loop │ │
│ │ ┌───────────┐ │ │
│ │ │ Process │ │ │
│ │ │ Batch │ │ │
│ │ │ ↓ │ │ │
│ │ │ Save │ │ │
│ │ │Checkpoint │ │ │
│ │ │ ↓ │ │ │
│ │ │ More? │──┼──► No ──► Complete! │
│ │ └─────┬─────┘ │ Delete Checkpoint │
│ │ │Yes │ │
│ │ └────────┘ │
│ └─────────────────┘ │
│ │
└──────────────────────────────────────────────────────────────────┘
SafeMapper works out of the box, but you can customize settings as needed:
┌─────────────────────────────────────────────────────────────────┐
│ SafeMapper Core Advantages │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ✅ Zero Config ─────────► Works out of the box │
│ │
│ ✅ Auto Recovery ────────► Just re-run to resume │
│ │
│ ✅ Drop-in ──────────────► 100% compatible with purrr/furrr │
│ │
│ ✅ Transparent ──────────► Auto checkpoint, no manual work │
│ │
│ ✅ Parallel Support ─────► Full furrr compatibility │
│ │
└─────────────────────────────────────────────────────────────────┘
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.