Error when compiling pdf using knitr in rstudio
Although I still do not understand why, but from the comments above, the problem seems to come from ~/.Rprofile
(in particular, setwd()
). Clearing it up solves the problem.
Note you may have other startup profile files. .Rprofile
is only one possibility. See ?Startup
for more information. For example, if you are on Windows, you may need to take a look at C:\Program Files\R\etc\Rprofile.site
if it exists.
Knitr compiling and running all at the same time in RStudio
When you knit a document, the work happens in a different R session, which is why you can't examine the results in the current session.
But you have a lot of choices besides run all. Take a look at the Run button: it allows you to run chunks one at a time, or run all previous chunks, etc.
If some of your chunks take too long to run, then you should consider organizing your work differently. Put the long computations into their own script, and save the results of that script using save()
. Run it once, then spend time editing the display of those results in multiple runs in the main .Rnw document.
Finally, if you really want to see variables at the end of a run of your vignette, you can add save.image(file = 'vignette.RData')
at the end, and in your interactive session, use load('vignette.RData')
to load the values for examination. This won't necessarily give you an accurate view of the state of things at the end of the run, because it will load the values in addition to anything you've already got in your workspace, it won't load option settings or attach packages, but it might be enough for debugging.
Error generating .pdf using knitr to PDF in RStudio
According to the comments, the answer posted at https://tex.stackexchange.com/a/27141 solved the issue.
The relevant part:
Remedy: start MiKTeX Options and choose either Yes or No (but not "Ask
me first") for the option "Install missing packages on-the-fly"
Related Topics
Convert a Mm-Yy String "Jan-01" into Date Format
How to Use With/Within Inside a Function
How to Suppress Warnings from Stats:::Regularize.Values
Loop Through a Series of Qplots
R: Interpolation of Nas by Group
How to Increase Smoothness of Spheres3D in Rgl
Print Tibble with Column Breaks as in V1.3.0
Vary the Color Gradient on a Scatter Plot Created with Ggplot2
Download Plotly Using Downloadhandler
Plot Line and Bar Graph (With Secondary Axis for Line Graph) Using Ggplot
Missing Data When Supplying a Dual-Axis--Multiple-Traces to Subplot
How to Change the Default Directory in Rstudio (Or R)
Error in Na.Fail.Default: Missing Values in Object - But No Missing Values
Is There a Limit for the Possible Number of Nested Ifelse Statements
How to Print a Variable Inside a for Loop to the Console in Real Time as the Loop Is Running
How to 'Unlist' a Column in a Data.Table