This function takes a list of Rnw or other LaTeX source files, attempts to knit each one to a PDF using the knit2pdf function, and tracks the success or failure of each attempt.

compile_rnws(file_list = NULL, clean = TRUE)

Arguments

file_list

A character vector containing the file paths to the Rnw or LaTeX source files. If NULL, the function will search for all .Rnw files in the current directory.

Value

A data frame with two columns:

file

The name of the file that was processed.

success

Logical value indicating whether the knitting process was successful (TRUE) or encountered an error (FALSE).

Details

The function iterates through the list of files, attempts to compile each one using knit2pdf, and stores the result (success or failure) in a data frame. If an error occurs during the knitting process, the function will skip that file and proceed to the next one.

Examples

if (FALSE) { # \dontrun{
  file_list = list.files(pattern = "^Sta.*Rnw", ignore.case = TRUE)
  knit_results <- compile_rnws(file_list)
  print(knit_results)
} # }