for a few weeks now I have been learning a minimal amount of R, rmd, and about knitR to construct a program in r that will compile a pdf containing particular images. Once finished, it will become part of a larger project involving the creation of dense write-ups for users.
I have been struggling with trying to change the "fields" if you will (I am not sure what to call them for a latex document) proactively. For example...
\graphicspath{ {figures\} }
\title{\textbf{Document name}}
\author{Me, My Professor, Collaborators}
The above code is compiled properly in to a PDF by either pressing the button above the coding window or by using the command knit2pdf(input.location, output.location) in an r file.
It would seem a latex document is a little different from an r file is that passing values between them is more difficult then between two r files.
Is it possible to make variables for each of the parameters in each of the expressions that I could change either through r, or through some method in latex?
A hypothetical and ideal solution that I have found does not work (or is not at all straight-forward) is:
\graphicspath{ {filepathVariable} }
\title{\textbf{nameVariable}}
\author{authorsVariable}
If it helps, here is the r code that compiles the PDF
library(knitr)
createpdf <- function(input.path, output.path){
knit2pdf(input = input.path, output = output.path)
}