I am trying to create a R markdown like below. In a vector called app, I will have several application, will go though and create a pdf file
---
title: "Java Based Apps"
date: "January 13, 2017"
output:
pdf_document:
number_sections: yes
toc: true
highlight: zenburn
fig_width: 7
fig_height: 6
fig_caption: true
tables: yes
keep_tex: true
fontsize: 12
---
```{r message=FALSE, results = 'asis', echo=FALSE, warning=FALSE}
app<-c("Sample APP")
for (i in app){
cat(paste("## ", "- Correlation Analysis between performance KPI's"))
cat("\n")
m<-corrplot(M, method="number")
cat(paste("## ", "- JVM %CPU Usage"))
cat("\n")
print(ggplot(data, aes(Date, JVM_CPU, group=JVM))+geom_point()+geom_smooth(method="lm",se=F)+theme_bw()+
ggtitle(paste(i, " - JVM %CPU Usage/15 Minute Interval"))+facet_wrap(~JVM, scale="free"))
cat(paste("## ", "- JVM Heap Usage"))
cat("\n")
print(ggplot(data, aes(Date, JVM_Mem, group=JVM))+geom_point()+geom_smooth(method="lm",se=F)+theme_bw()+
ggtitle(paste(i, " - JVM Memory Usage/15 Minute Interval"))+facet_wrap(~JVM, scale="free")+ylab("Memory Usage/MG"))
}
```
the output needs to be like this:
Sample App
- Correlation Analysis between performance KPI's
- JVM %CPU Usage
- JVM Heap Usage
etc
I am seeing this:
Sample App
- Correlation Analysis between performance KPI's
but others are not being created as subsections. Any idea what I am doing wrong here?
To indicate a subscript, use the underscore _ character. To indicate a superscript, use a single caret character ^ . Note: this can be confusing, because the R Markdown language delimits superscripts with two carets.
To break a line in R Markdown and have it appear in your output, use two trailing spaces and then hit return .
The following sections dive into the three components of an R Markdown document in more details: the markdown text, the code chunks, and the YAML header.
To create an R Markdown report, open a plain text file and save it with the extension . Rmd. You can open a plain text file in your scripts editor by clicking File > New File > Text File in the RStudio toolbar. Be sure to save the file with the extension .
Add cat("\n\n")
after each plot to add space. That should help make the ## work to separate the subsections properly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With