Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with special characters in R code chunks #988

Closed
cbeleites opened this issue Apr 8, 2015 · 4 comments
Closed

Issue with special characters in R code chunks #988

cbeleites opened this issue Apr 8, 2015 · 4 comments
Labels
bug Bugs
Milestone

Comments

@cbeleites
Copy link

It seems each special character "eats" one character at the beginning of a comment* in the same line

* more precisely: after the end of R statements in that line

ϱ <- 1# g / ml
ϱ <- 1 # g / ml
ϱ <- 1  # g / ml
äöüßÄÖÜπ <- 7 + 3# nonsense

knits to the following markdown:

ϱ <- 1 g / ml
ϱ <- 1# g / ml
ϱ <- 1 # g / ml
äöüßÄÖÜπ <- 7 + 3se

In multiline statements, only the last line is affected:

äöüßÄÖÜπ <- 7 + # comment 1
3 + ϱ + # nonsense
3 + ϱ # nonsense

becomes

äöüßÄÖÜπ <- 7 + # comment 1
3 + ϱ + # nonsense
3 + ϱ# nonsense

sessionInfo()
## R version 3.1.3 (2015-03-09)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 14.04.2 LTS
## 
## locale:
##  [1] LC_CTYPE=de_DE.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=de_DE.UTF-8        LC_COLLATE=de_DE.UTF-8    
##  [5] LC_MONETARY=de_DE.UTF-8    LC_MESSAGES=de_DE.UTF-8   
##  [7] LC_PAPER=de_DE.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## loaded via a namespace (and not attached):
## [1] digest_0.6.8    evaluate_0.5.5  formatR_1.0     htmltools_0.2.6
## [5] knitr_1.9       rmarkdown_0.5.1 stringr_0.6.2   tools_3.1.3    
## [9] yaml_2.1.13
@yihui yihui added the bug Bugs label Apr 10, 2015
@yihui yihui added this to the v1.10 milestone Apr 10, 2015
@yihui
Copy link
Owner

yihui commented Apr 10, 2015

Confirmed and reported to r-lib/evaluate#49 Thanks!

@yihui
Copy link
Owner

yihui commented Apr 13, 2015

I have submitted a fix to evaluate, and you may test it by

devtools::install_github('hadley/evaluate@bugfix/49-srcref')

if you want. Or just wait for the next CRAN release.

@yihui
Copy link
Owner

yihui commented Apr 14, 2015

Version 0.6 of the evaluate package is on CRAN now.

jsonn pushed a commit to jsonn/pkgsrc that referenced this issue Apr 17, 2016
Upstream changes:
Version 0.8.3
------------------------------------------------------------------------------

* Added an argument `filename` to evaluate() and parse_all() (thanks,
  @flying-sheep, #58).

Version 0.8
------------------------------------------------------------------------------

* Changed package license to MIT.

Version 0.7.2
------------------------------------------------------------------------------

* replay() fails to replay certain objects such as NULL (#53).

Version 0.7
------------------------------------------------------------------------------

* R 3.0.2 is the minimal required version for this package now.

Version 0.6
------------------------------------------------------------------------------

* Plots are no longer recorded when the current graphical device has been
  changed, which may introduce issues like yihui/knitr#824.

* `parse_all()` can parse R code that contains multibyte characters correctly
  now (#49, yihui/knitr#988)
@github-actions
Copy link

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bugs
Projects
None yet
Development

No branches or pull requests

2 participants