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

-> 符号处理的问题 #31

Closed
bsspirit opened this issue Dec 4, 2013 · 1 comment
Closed

-> 符号处理的问题 #31

bsspirit opened this issue Dec 4, 2013 · 1 comment
Labels

Comments

@bsspirit
Copy link

bsspirit commented Dec 4, 2013

replace_assignment 函数没有判断"->"符号,虽然很少人会这样写,但语法上确实存在这个问题。

c('11',832)->x2
x2
[1] "11" "832"

tidy.source(text="c('11',832)->x2")
c("11", 832) <- x2

tidy.eval(text="c('11',832)->x2")
c("11", 832) <- x2
Error in eval(expr, envir, enclos) : object 'x2' not found

@yihui
Copy link
Owner

yihui commented Dec 4, 2013

谢谢,不过这个问题已经在R 3.0.2中修正了。

> formatR::tidy.source(text="c('11',832)->x2")
x2 <- c("11", 832) 
> sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] formatR_0.10.3

@bsspirit bsspirit closed this as completed Dec 4, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants