I am trying to refer the graph from R file to the Rmd file. In the R file, I used the following code to generate the final graph from the viewport.
The code is :
library(grid)
grid.newpage()
pushViewport(viewport(layout = grid.layout(1, 2)))
vplayout <- function(x, y)
viewport(layout.pos.row = x, layout.pos.col = y)
print(k1, vp = vplayout(1, 1))
print(k2, vp = vplayout(1,2))
Now, when I try to use that chunk of code to the Rmd file then it doesn't shows anything. How can I display such image on knitr output (markdown file).
```{r}
source("../../../Calibration Model/R code/monitoring stations for calibration.R")
library(grid)
grid.newpage()
pushViewport(viewport(layout = grid.layout(1, 2)))
vplayout <- function(x, y)
viewport(layout.pos.row = x, layout.pos.col = y)
print(k1, vp = vplayout(1, 1))
print(k2, vp = vplayout(1,2))
```
Here the file name "monitoring stations for calibration.R" is the file where I have k1 and k2 figures. I want to combined those two and show as a new figure. Is it possible to do using knitr ?
Thank you for any help.