I am new to knitr and markdown and this is my first question asked. Maybe this question has a simple answer that I just can't find.
I have a for-loop, which creates 3 ggplots. The loop runs 300 to 400 times depending on the data input. I want to define the size of these 3 pictures as:
1st picture: width = 7, height = 3
2nd picture: width = 7, height = 3
3nd picture: width = 7, height = 12
So far I am using the following code:
```{r calc, echo=FALSE, warning=FALSE, message=FALSE, results='asis', fig.show='asis',fig.height=3}
for(x.PS in 1:length(trace.input))
{
# some data transformation by self-written functions
# create and save plot for the normalised version
ggp.PS.norm <- ggplot(print.PS.norm, aes(x = Time, y = Voltage, col = Pulse))
fig.PS.norm <- ggp.PS.norm + geom_line()
# create and save plot for the modified version
ggp.PS.smooth <- ggplot(print.PS.smooth, aes(x = Time, y = Voltage, col = Pulse))
fig.PS.smooth <- ggp.PS.smooth + geom_line()
# create and save plot for the modified version as facet grid
fig.PS.smooth.single <- ggp.PS.smooth + geom_line() + facet_grid(FigCol ~ FigRow)
print(fig.PS.norm)
print(fig.PS.smooth)
print(fig.PS.smooth.single)
}
```
In the end I hope to get one big PDF-file with 3 x 300 to 400 pictures
I hope this code is understandable even without any hard data.
best paj