简体   繁体   中英

R equivalent of python “_”?

Python has an identifier _ that allows for storing the result of the last evaluation which makes it great for speeding up data exploration and introspection.

In [1]: 43 * 2
Out[1]: 86

In [2]: _ + 1
Out[2]: 87

Is there a similar command in R?

Tis a faff to type, but .Last.value:

> sqrt(2)
[1] 1.414214
> .Last.value
[1] 1.414214

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM