On 20/04/2010 2:03 PM, Xie Chao wrote:
Dear All,

I am wondering is there any shift (or pop or push or unshift) equivalent in R?
For example,
shift(x)   # should return x[1], and x becomes x[-1]

Not in base R. Generally speaking, functions with side effects are frowned upon. It is possible to write it yourself, but you need to watch out for weird cases like

shift(x + y)

where it's not at all clear what the side effect should be.

Duncan Murdoch
Thanks a lot.

Best Regards,
Xie Chao

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to