[//]: # Remember to run the date code above and insert the output to preserve date of creation (this is how you enter a comment to markdown)
library(knitr) library(tidyverse) library(captioner) library(jpfxns2)
opts_chunk$set(echo = TRUE)
#### set working directories (uncommnent and comment depending on computer) ### Base directories on all computers ## BlueRebel and jacpeteLaptop baseDir<-"/home/jacpete/RemoteMountedDrives/PurdueDataDepot" ## PurdueDataDepot # baseDir<-"/depot/pzollner/data/JacobP" ### ## BaseDataDirOnPurdueDataDepot baseData<-"class/InformaticsABE" ### Set Base Working Directory for Data basePath <- file.path(baseDir,baseData) rm(baseDir, baseData)
figNum <- captioner(prefix="Fig.") TabNum <- captioner(prefix="Table")
Figures are captioned by plotting in one chunck and then providing a caption in the following chunk with the option results="asis"
.
qplot(carat, price, data = ggplot2::diamonds)
jpfxns2::adaptiveCenterCaption(chunckName="Plot-Caret-Price", caption = "This is caption 1", capFxn = "figNum")
kable(ggplot2::diamonds[1:10,])
jpfxns2::adaptiveCenterCaption(chunckName="Draw-Table", caption = "First 10 records in the diamonds table from ggplot2.", capFxn = "TabNum")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.