Learn R Programming

ankiR (version 0.6.0)

anki_cards_fsrs: Read cards with FSRS-6 parameters

Description

Extracts cards along with their FSRS (Free Spaced Repetition Scheduler) memory state parameters. FSRS-6 stores stability, difficulty, and a per-card decay parameter in the card's data field.

Usage

anki_cards_fsrs(path = NULL, profile = NULL)

Value

A tibble of cards with FSRS parameters:

  • cid - Card ID

  • nid - Note ID

  • did - Deck ID

  • type - Card type (0=new, 1=learning, 2=review, 3=relearning)

  • queue - Queue (-1=suspended, 0=new, 1=learning, 2=review, 3=day learning, 4=preview)

  • due - Due date/position

  • ivl - Current interval in days

  • reps - Number of reviews

  • lapses - Number of lapses

  • stability - FSRS stability (S) in days

  • difficulty - FSRS difficulty (D), range 1-10

  • desired_retention - Target retention rate

  • decay - FSRS-6 decay parameter (w20), typically 0.1-0.8

Arguments

path

Path to collection.anki2 (auto-detected if NULL)

profile

Profile name (first profile if NULL)

Examples

Run this code
if (FALSE) {
cards_fsrs <- anki_cards_fsrs()
# Calculate current retrievability
cards_fsrs$retrievability <- fsrs_retrievability(
  stability = cards_fsrs$stability,
  days_elapsed = as.numeric(Sys.Date() - as.Date("1970-01-01")) -
                 cards_fsrs$due / 86400,
  decay = cards_fsrs$decay
)
}

Run the code above in your browser using DataLab