0

Do you know if in R markdown you can use go to the new page without distorting print(df) ie. data.frame's printing? For pdf generation the simple example is:

---
output: pdf_document
---

```{r, results='asis', echo=F, fig.width=8, fig.height=5}
for (year in 1:10) {
    plot(1:year)
    df<-data.frame(rep("costam", year),1:year)
    cat("\n\n")
    print(df)
    cat("\\newpage")
}
```

Here, due to results='asis' the cat() command goes to new page; however, the data frame's are printed as strings.

  • It is helpful if you want to print chart together with its summary for a long... long... list of charts then can do it in a neat standardize way.

0 Answers0