I wrote an R script to read data from csv file and print these data into different Word Doc (docx) files by using the following code. This is working as expected without any glitch. But what I don't know to achieve is to use 'knitr' or 'sweave' to output pdf files instead. Can some one direct me how to make the script to output pdf files instead of docx?
library(ggplot2)
library(reshape)
lff <- list.files(path = "./data/", pattern = paste('*.csv*',sep=""),
full.names = TRUE, recursive = TRUE, include.dirs = TRUE)
for (i in 1:length(lff)) {
....
writeDoc( doc, filename )
}