Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R equivalent of python "_"?

Tags:

python

r

ipython

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?

like image 862
Stedy Avatar asked Feb 11 '11 19:02

Stedy


People also ask

What is for _ in range?

“for _ in range python” Code Answer's Basically it means you are not interested in how many times the loop is run till now just that it should run some specific number of times overall.

What is r command in Python?

r means raw input . If a string is marked as r , then the meaning of any special character whithin the string will be ignored, the most frequently situation will be the backslash .

How do you paste a function in Python?

Image. Image. paste() method is used to paste an image on another image. This is where the new() method comes in handy.


1 Answers

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

> sqrt(2) [1] 1.414214 > .Last.value [1] 1.414214 
like image 51
Spacedman Avatar answered Oct 09 '22 08:10

Spacedman