require(lubridate) require(stringr) knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE) ## read parameters scorecard_dir <- params$scorecard_dir scorecard_date <- params$scorecard_date
# find the figures to use # figures should have been written by scorecard_produce if ( is.na(scorecard_date) || str_length(scorecard_date) < 3 ) { # workspace not overridden in environment, so find in directory # find the scorecard workspace directory and load files scorecard_date <- strftime(lubridate::today("America/Chicago"), format = "%Y%m%d") message(paste("Using today's scorecard date",scorecard_date)) } else { message(paste("Using argument-specified date",scorecard_date)) } sac <- file.path(scorecard_dir,paste(scorecard_date,"sc","actual.png",sep="_")) se <- file.path(scorecard_dir,paste(scorecard_date,"sc","expected.png",sep="_")) sbm <- file.path(scorecard_dir,paste(scorecard_date,"sc","benchmark.png",sep="_")) sbh <- file.path(scorecard_dir,paste(scorecard_date,"sc","buyhold.png",sep="_")) so <- file.path(scorecard_dir,paste(scorecard_date,"sc","oos.png",sep="_"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.