I'm wondering if anyone else has seen this behavior with the dev version of the reprex package and
(x <- rnorm(3)) #>  -0.5145298 -0.8394305 1.1100893 mean(x) #>  -0.08129035
Created on 2020-09-20 by the reprex package (v0.3.0.9001)
The above was made with
reprex(). So far so good. However, if I copy the same code and run
reprex_rtf() on it, the resulting pasted output looks like this:
#' (x <- rnorm(3)) #' #>  1.697790 -1.077479 1.061037 #' mean(x) #' #>  0.5604493
That is, every line is prefaced with a
Output (rendered in HTML) sent to the Viewer in RStudio or a temporary HTML does not have additional
#' characters inserted (though it's not syntax highlighted either).
I can run the equivalent
highlight command from the command line, e.g.
highlight foo_reprex.R --out-format rtf --no-trailing-nl --encoding=UTF-8 --style moe --font-size 30 | pbcopy
and it works as expected. So I'm not sure where these comments characters are being inserted in the rendering process. I can't rule out of course that some idiosyncratic feature of my own R setup is responsible for this, but I can reproduce this issue with e.g.
R --no-init-file and just a call to
Can anyone else can reproduce this behavior? If not I guess it's some weird problem of my own.
R version 4.0.2 (2020-06-22) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Catalina 10.15.6 Matrix products: default BLAS: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib locale:  en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages:  stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached):  knitr_1.29 magrittr_1.5 R6_2.4.1 rlang_0.4.7  styler_1.3.2 highr_0.8 tools_4.0.2 xfun_0.17  clipr_0.7.0 withr_2.2.0 htmltools_0.5.0 ellipsis_0.3.1  yaml_2.2.1 digest_0.6.25 tibble_3.0.3 lifecycle_0.2.0  crayon_1.3.4 processx_3.4.4 purrr_0.3.4 callr_3.4.4  vctrs_0.3.4 fs_1.5.0 ps_1.3.4 glue_1.4.2  evaluate_0.14 rmarkdown_2.3 reprex_0.3.0.9001 compiler_4.0.2  pillar_1.4.6 backports_1.1.10 pkgconfig_2.0.3