Closed cyrus621 closed 11 years ago
This should not be an issue of the formatR
package, since it no longer depends on parser
. I do not know what happened in the current version of the parser
package, but I think this issue can be solved by library(parser)
. In future (after R 3.0.0 comes out) the dependencies on highlight
and parser
will be completely removed, and knitr
will support native syntax highlighting.
谢先生,thanks so much! Yes, that solved the problem. I suppose forcing parser to load (I used require rather than library) was necessary because formatR does not load parser any more.
Thanks so much for this wonderful package!! I was a loyal Sweave user, many thanks to Leisch for leading the way, but your solution is much more elegant. I converted with about one day of trial and error.
Glad to know the problem was solved, and thanks for the kind words :smiley:
Last year there was the issue https://github.com/yihui/knitr/issues/18 where running knitR with highlight=TRUE resulted in the error:
I have been using knitr w/o problems but now after updating to R2.15.2 and the latest packages I get the same problem. Code compiles with highlight=FALSE but not =TRUE
In the .Rnw source:
versions (all up-to-date via update.packages(dependencies=TRUE):