1Answer
  • 14
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

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
  • 42
Reply Report
    • I agree that the name is difficult to remember. You could do this:.Last() function() (return(.Last.value)); a <- 3 #> .Last() [1] 3
    • Try this: makeActiveBinding(".",function() .Last.value,env=.GlobalEnv) then "." is the value, similar to "_".

Trending Tags