[Rd] deparse operators in expressions

From: Yihui Xie <xie_at_yihui.name>
Date: Sat, 09 Apr 2011 20:43:00 -0500


I observed a slight problem in deparse(): it will add spaces around most operators except /. I wonder if this is easy to fix. I know this is quite trivial, but I will appreciate if / is not treated as an exception. Examples:

> deparse(expression(1/1))

[1] "expression(1/1)"
> deparse(expression(1+1))

[1] "expression(1 + 1)"
> deparse(expression(1%in%1))

[1] "expression(1 %in% 1)"

> sessionInfo()

R version 2.12.2 (2011-02-25)
Platform: x86_64-pc-linux-gnu (64-bit)


 [1] LC_CTYPE=en_US.utf8       LC_NUMERIC=C
 [3] LC_TIME=en_US.utf8        LC_COLLATE=en_US.utf8
 [5] LC_MONETARY=C             LC_MESSAGES=en_US.utf8
 [7] LC_PAPER=en_US.utf8       LC_NAME=C
 [9] LC_ADDRESS=C              LC_TELEPHONE=C

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


Yihui Xie <xieyihui_at_gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA

R-devel_at_r-project.org mailing list
Received on Sun 10 Apr 2011 - 01:46:15 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 10 Apr 2011 - 13:30:43 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive