knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) library(projmgr)
Communication is a critical part of project planning. For this, projmgr
provides a family of report
functions. These functions translate certain R objects like lists or dataframes into HTML code which will render nicely when knitted to HTML in an RMarkdown document.
Recall that plans and to-do lists can be written in YAML. For example:
plan_path <- system.file("extdata", "plan.yml", package = "projmgr", mustWork = TRUE) cat(readLines(plan_path), sep = '\n')
The report_plan()
function converts plans into formatted HTML for inclusion in RMarkdown documents for more aesthetic reporting.
plan <- read_plan(plan_path) report_plan(plan)
The report_todo()
function works similarly.
Similarly, any issue-milestone data pulled back down from GitHub can be reported in a similar format with report_progress()
.
issues <- readRDS(system.file("extdata", "anproj-issues.rds", package = "projmgr", mustWork = TRUE))
report_progress(issues)
pkg_issues <- readRDS(system.file("extdata", "viz-issues-data.rds", package = "projmgr", mustWork = TRUE)) pkg_issues$url <- ""
Using HTML and CSS grid, the report_taskboard()
function also offers aesethetic and interactive views of your work.
report_taskboard(pkg_issues, in_progress_when = is_assigned_to("emilyriederer"))
Users specify what logic to use for identifying "in progress" items by passing a function factory to the in_progress_when
parameter. The above example uses the is_labeled_with()
option. Other options include:
ls('package:projmgr')[grep("^is_*", ls('package:projmgr'))]
See ?taskboard_helpers
for more details.
Optional parameters of this function are include_link
(whether to link back to the relevant GitHub issue), hover
(for slightly enlarging a task on hover), and colors
(to provide a character vector of colors to override the defaults.)
As a second example, suppose we instead classify issues as in progress once they have been put in a milestone.
report_taskboard(pkg_issues, in_progress_when = is_in_a_milestone(), include_link = FALSE, hover = TRUE, colors = c('#ff0000', '#00ff00', '#0000ff'))
Additionally, full issues discussions can be pulled from GitHub and reformatted to HTML for long-term documentation with the report_discussion()
function.
issues <- get_issues(experigit, number = 163) %>% parse_issues() comments <- get_issue_comments(experigit, number = 163) %>% parse_issue_comments()
issues <- readRDS(system.file("extdata", "disc-issues.rds", package = "projmgr", mustWork = TRUE)) comments <- readRDS(system.file("extdata", "disc-comments.rds", package = "projmgr", mustWork = TRUE))
report_discussion(comments, issues)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.