| Title: | Gamified Algorithmic and Data Wrangling Challenges for R |
|---|---|
| Description: | An in-console, gamified learning and practice engine for R. Solve algorithmic and data-wrangling challenges directly in the R console, get instant styled feedback with worked explanations, and track your progress locally with a solving streak, attempt history, and an activity heatmap. |
| Authors: | Uwakmfon Paul [aut, cre] |
| Maintainer: | Uwakmfon Paul <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-10-07 09:27:16 UTC |
| Source: | https://github.com/devwebwacky/rgrind |
Returns the ids of every challenge currently registered in the
package. Use an id with run_challenge() to attempt that challenge.
list_challenges()list_challenges()
A character vector of challenge ids.
list_challenges()list_challenges()
Returns every attempt you've made across all challenges, including both passes and failures, stored locally on your machine.
rg_get_history()rg_get_history()
A data frame with columns challenge_id, timestamp, and
passed.
old_opt <- options(rgrind.storage_dir = tempdir()) rg_get_history() options(old_opt)old_opt <- options(rgrind.storage_dir = tempdir()) rg_get_history() options(old_opt)
Calculates how many consecutive days (ending today or yesterday) you've passed at least one challenge. A streak is still considered active if you solved something yesterday but haven't yet today.
rg_get_streak()rg_get_streak()
An integer: the current streak length in days.
old_opt <- options(rgrind.storage_dir = tempdir()) rg_get_streak() options(old_opt)old_opt <- options(rgrind.storage_dir = tempdir()) rg_get_streak() options(old_opt)
Prints a simple ASCII grid showing how many challenges you passed each day over the last 28 days, similar in spirit to GitHub's contribution graph.
rg_heatmap()rg_heatmap()
Invisibly, a character vector of the rendered symbols.
old_opt <- options(rgrind.storage_dir = tempdir()) rg_heatmap() options(old_opt)old_opt <- options(rgrind.storage_dir = tempdir()) rg_heatmap() options(old_opt)
Permanently deletes your locally stored attempt history, including streak data. This cannot be undone.
rg_reset_history()rg_reset_history()
Invisibly, TRUE.
old_opt <- options(rgrind.storage_dir = tempdir()) rg_reset_history() options(old_opt)old_opt <- options(rgrind.storage_dir = tempdir()) rg_reset_history() options(old_opt)
Prints how many challenges you've solved, your total attempts, and your current and longest solving streaks.
rg_stats()rg_stats()
Invisibly, a list with solved, total_challenges,
attempts, current_streak, and longest_streak.
old_opt <- options(rgrind.storage_dir = tempdir()) rg_stats() options(old_opt)old_opt <- options(rgrind.storage_dir = tempdir()) rg_stats() options(old_opt)
Tests a user-submitted function against a challenge's test cases, printing styled pass/fail feedback to the console. On a full pass, shows an explanation of the idiomatic solution and updates your local solving streak. On any failure, shows details for the failed tests and a hint.
run_challenge(challenge_id, user_fun)run_challenge(challenge_id, user_fun)
challenge_id |
Character. The id of the challenge to run.
See |
user_fun |
Function. Your own solution to test — written and defined in your own R session, then passed in directly. |
Invisibly, a list with passed (number of test cases
passed) and total (total number of test cases).
old_opt <- options(rgrind.storage_dir = tempdir()) my_solution <- function(x) sum(x[x %% 2 == 0], na.rm = TRUE) run_challenge("sum_evens", my_solution) options(old_opt)old_opt <- options(rgrind.storage_dir = tempdir()) my_solution <- function(x) sum(x[x %% 2 == 0], na.rm = TRUE) run_challenge("sum_evens", my_solution) options(old_opt)