Suppose I'm using R's interactive console, and I've just done something like this:
long_running_command()
That long-running command returns a value, and I've just realized that I wanted to assign that value to a variable instead of discard it. So how can I get that value without running the command again? Is there a command like this?
result = get_last_return_value()
The = symbol is known as the assignment operator. It is also possible to declare a variable and assign it a value in the same line, so instead of int i and then i = 9 you can write int i = 9 all in one go. If you have more than one variable of the same type you can also declare them together e.g.
You can assign a value to a routine variable in any of the following ways: Use a LET statement. Use a SELECT INTO statement. Use a CALL statement with a procedure that has a RETURNING clause.
To "assign a value to a variable" is something you tell the computer to do. Once the value has been assigned to the variable, the variable holds that value. To "assign a variable to a value" is something you do. It means to designate a specific variable to hold a certain value.
.Last.value
is an answer.
It was answered once but you have better title.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With