Open fjaraavilaa opened 7 years ago
Do you have RStudio configured to use knitr rather than Sweave?
Are there any old-style Sweave options or values hiding in there? See https://yihui.name/knitr/demo/sweave/ for info on sussing these out.
I would argue that library() is preferable. I found that the following as helpful:
https://stackoverflow.com/questions/5595512/what-is-the-difference-between-require-and-library
WHICH STATES:
It is probably best to avoid using require() unless you actually will be using the value it returns e.g in some error checking loop such as given by thierry.
In most other cases it is better to use library(), because this will give an error message at package loading time if the package is not available.
But library()
is such a bad name for newbies, and I don't find error-generation to be compelling. They will get errors as soon as they try to do something with the package, and when working interactively, the messaging from require()
is also sufficient.
While I agree with the name preference most others in the community are using library() and I agree with them that require() is most appropriate if you are going to look at the return status. Finally I want an r markdown file to fail compilation if a needed package isn’t installed (as opposed to generating a bunch of messages).
All the best,
Nick
On Jun 8, 2018, at 2:36 PM, Randall Pruim notifications@github.com wrote:
But library() is such a bad name for newbies, and I don't find error-generation to be compelling. They will get errors as soon as they try to do something with the package, and when working interactively, the messaging from require() is also sufficient.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
When running the Students Manual it shows this error. Ran with the TeX document generated. Shows this error: ! LaTeX Error: File `Sweave.sty' not found. Likely a needed change with the most updated version of knitr.