This guide assumes you’ve already solved at least one challenge, if you haven’t yet, start with Getting Started with rgrind first.
Every time you attempt a challenge, rgrind quietly
records it, locally, on your own machine, in a small file it manages for
you. Nothing is ever sent anywhere. This local history is what powers
streaks, stats, and the activity heatmap.
library(rgrind)
run_challenge("sum_evens", function(x) sum(x[x %% 2 == 0], na.rm = TRUE))
#>
#> ── Sum of Even Numbers ─────────────────────────────────────────────────────────
#> Base R Optimisation • Easy
#>
#> ────────────────────────────────────────────────────────────────────────────────
#> ✔ All 7 tests passed!
#> 🔥 Current streak: 1 day
#>
#> ── Explanation
#> Idiomatic solution: sum(x[x %% 2 == 0], na.rm = TRUE) This avoids a for-loop
#> entirely by using R's vectorised modulo operator to build a logical mask, then
#> subsetting. This is roughly 50-100x faster than a for-loop for large vectors
#> because R's C-level vectorised operations avoid per-element interpreter
#> overhead.
#> Notice the line with a flame, that’s your current streak: the number of consecutive days (including today) on which you’ve solved at least one challenge.
A streak counts calendar days with at least one passing solve, not individual solves. Solving five challenges today still only counts as one streak day. Solving nothing today doesn’t break your streak immediately either, your streak stays alive until the day after the one you last solved something, giving you until the end of today to keep it going.
rg_stats()
#>
#> ── Your rgrind Stats ───────────────────────────────────────────────────────────
#> ℹ Challenges solved: 1/10
#> ℹ Total attempts: 1
#> ℹ 🔥 Current streak: 1 day
#> ℹ 🏆 Longest streak: 1 dayThis shows:
rg_heatmap()
#>
#> ── Last 28 Days
#> · · · · · · ·
#> · · · · · · ·
#> · · · · · · ·
#> · · · · · · ▪
#>
#> · none ▪ 1 ▓ 2-3 █ 4+This shows the last 28 days as a simple grid, one row per week. Each symbol represents how many challenges you passed that day:
· : no solves that day▪ : 1 solve▓ : 2-3 solves█ : 4 or more solvesIt’s a quick visual way to see your consistency over time — the kind of thing that’s satisfying to watch fill in as you build a habit.
If you want the full underlying data, every single attempt, with timestamps, you can access it directly:
This can be useful if you want to analyse your own progress further (for example, seeing which challenges took you multiple attempts).
If you ever want to wipe your local history completely, for example, if you’re demonstrating the package to someone else, or just want a clean slate, you can reset it:
This cannot be undone, so use it deliberately.
That’s the full loop: solve challenges, build a streak, watch your
heatmap fill in. Run list_challenges() any time to see
what’s left to try, and come back daily to keep your streak alive.