Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an expression in `R` for "output of the last command"? [duplicate]

Tags:

r

In Mathematica, the output of the last expression can be accessed using the symbol %. In particular, one can do the following in Mathematica:

1+2
% / 3

This will return the output 1, because the output of the first expression is 3, and 3/3 = 1.

Is there an equivalent functionality in R?

like image 356
merlin2011 Avatar asked Nov 17 '13 02:11

merlin2011


People also ask

What is the output of last command?

The last command displays information about the last logged-in users. It's pretty convenient and handy when we need to track login activities or investigate a possible security breach. The last command will, by default, take the system log file /var/log/wtmp as the data source to generate reports.

How do you escape the console in R?

It depends on how you're running R. In the terminal, the “normal” way is Control + C – the “cancel” key combination. In the graphical R application and in RStudio, it's Escape .

How do you go to the next line in R without running the code?

Use'SHIFT-ENTER' to get to a new line in R without executing the command.


1 Answers

Here you go. Try ? .Last.value to learn more

1 + 2
.Last.value /3
like image 153
Ramnath Avatar answered Sep 29 '22 07:09

Ramnath