[//]: # 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")

First Section Heading and Main Document Starts Here

Plot Figures With Centered Captions

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")

Plot Figures With Centered Captions

kable(ggplot2::diamonds[1:10,])
jpfxns2::adaptiveCenterCaption(chunckName="Draw-Table", caption = "First 10 records in the diamonds table from ggplot2.", capFxn = "TabNum")


jacpete/jpfxns2 documentation built on May 10, 2020, 9:15 p.m.