New to markdown here... Probably missing something simple... I'm trying to create a markdown document with plots generated in a for loop, but want to prevent wrapping the plots == i.e., keep a single column.
This is similar to what appears here: Knitr how to prevent text wrapping in output. I can't get this to work for plots.
Ideally there could be a line break between each. I found this, but I'm not familiar with pandoc and it's adding another layer to what I am trying to keep simple. Will go this route if it's the best solution, but I bet there is something simpler. Putting the plots in a table? Haven't figured that out yet...
Example code (edited since first post):
```{r}
value <- rnorm(100)
index <- c(rep(1,20),rep(2,20),rep(3,20),rep(4,20),rep(5,20))
group1 <- 1:5
group2 <- 1:2
df <- as.data.frame(cbind(value,index,group1,group2))
for (i in unique(df$group1)){
par(mfrow=c(1,2))
plot(value~index,data=subset(df,group1==i & group2==1),type="l",pch=16,main=unique(paste("plot",i,"group=",group1)))
plot(value~index,data=subset(df,group1==i & group2==2),type="l",pch=16,main=unique(paste("plot",i,"group=",group2)))
box("outer")
}
```