README.md

journalr

The goal of journalr is to create markdown templates for journalling

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("andrewjpfeiffer/journalr")

Example

journalr consists of two primary functions journal_freeform() and journal_tactics().

Freeform journalling

journal_freeform() is used to create simple freeform journalling templates:

example_freeform <- journalr::journal_freeform(as.Date("2019-01-01"), 
                                               as.Date("2019-02-28"))

example_freeform$filename[1]
#> [1] "2019-01-freeform.md"

writeLines(substr(example_freeform$file_contents[1], 1, 64))
#> # January 2019
#> 
#> ## Tue 01 Jan 2019
#> 
#> * 
#> 
#> ## Wed 02 Jan 2019
#> 
#> *

example_freeform$filename[3]
#> [1] "monthly_freeform.md"

writeLines(example_freeform$file_contents[3])
#> # Monthly reflections: January 2019 to February 2019
#> 
#> ## January 2019 
#> 
#> * 
#> 
#> 
#> ## February 2019 
#> 
#> *

Tactics journalling

journal_tactics() is used to create journalling templates for tactics. This terminology is taken from 12 Week Year by Brian Moran, who recommends keeping score of how well you perform at tactics that contribute to higher-level goals.

journal_tactics() has three arguments:

  1. A template file, where each markdown list item (a line of text starting with a *, - or +) is read as a tactic.
  2. The start date, which must be a Sunday or Monday
  3. The end date, which must be a Saturday (if the start date is Sunday) or Sunday (if the start date is Monday)

Each row of the output is a template file for each week, and the last row is a template file for weekly reflections.

template_in <- "* Walk 10K steps each day\n* Read 30 minutes each day"

example_tactics <- journalr::journal_tactics(template_in, as.Date("2019-10-13"), 
                                             as.Date("2019-10-26"))

example_tactics$filename[1]
#> [1] "~w1-tactics.md"

writeLines(substr(example_tactics$file_contents[1], 1, 155))
#> # Week 1: Sun 13 Oct 2019 to Sat 19 Oct 2019
#> 
#> ## Walk 10K steps each day
#> 
#> ### Sun 13 Oct 2019 (<YES/NO/SKIP>)
#> 
#> * 
#> 
#> ### Mon 14 Oct 2019 (<YES/NO/SKIP>)
#> 
#> *

example_tactics$filename[3]
#> [1] "!weekly_tactics.md"

writeLines(substr(example_tactics$file_contents[3], 1, 242))
#> # Weekly reflections: Sun 13 Oct 2019 to Sat 26 Oct 2019
#> 
#> ## Walk 10K steps each day
#> 
#> ### Week 1: Sun 13 Oct 2019 to Sat 19 Oct 2019 - <YES/NO/SKIP> (<SCORE>)
#> 
#> * 
#> 
#> ### Week 2: Sun 20 Oct 2019 to Sat 26 Oct 2019 - <YES/NO/SKIP> (<SCORE>)
#> 
#> *

Shiny application

The shiny application for this package can be found at https://andrewjpfeiffer.shinyapps.io/journals. To use the application:



andrewjpfeiffer/journalr documentation built on Oct. 13, 2019, 9:19 p.m.