I am trying to use the function rebus.pls in the plspm library. This function generates a dendrogram and then prompts for user input (number of desired classes) before proceeding. (Sorry, I cannot provide a code sample as using this function requires a large amount of data.)
I want to produce a static report of my analysis process using knitr. I would be satisfied with either supplying the input during knitting (tedious but produces the desired output), or specifying the input within the Rmd document (preferred solution).
The function rebus.pls is not documented as accepting an optional argument to supply the number of classes. Nor does the documentation give me the name of a global variable I can set in advance. Therefore I believe I'm limited to either supplying the input during knitting, or simulating that by telling knitr in advance "when prompted for user input, use this response." I was unable to find instructions for doing either of those two things; I only found descriptions of how to create interactive HTML output with Shiny.
I am currently generating the reports by using 'knit' in RStudio but could use a *nix command-line solution, e.g.
echo "3" | Rscript -e "library(knitr); knit('Report.Rmd')"
Is this the best I can do or are there other solutions for my problem of "How can I use knitr when using a function which requires user input, when the desired output is a static PDF report using hardcoded input?" I'd prefer something a little more self-documentating.