The Journal of Statistical Software style guide prescripes use of R> as prompt character. In Sweave this can be obtained through:
options(prompt = "R> ", continue = "+ ", width = 70, useFancyQuotes = FALSE)
Is it possible to set the prompt character in knitr as well? It seems like the prompt argument in chunks$set only allows for TRUE/FALSE.
Use this kind of setup in the .Rnw file:
<<setup, include=FALSE, cache=FALSE>>=
library(knitr)
# set global chunk options
opts_chunk$set(prompt=TRUE)
options(replace.assign=TRUE, width=90, prompt="R> ")
@
Notice I say prompt=TRUE in the opts_chunk$set() and then specify what type of prompt in the options in the next line.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With