In normal R I can use .Last.value to retrieve the last value of an expression.
1+1
->2
.Last.value
->2
Doing the same with the pipe
1 %>% `+`(2)
->2
.Last.value
returns something very strange. It seem to return the result of a ls() call, so a list of all variables in the current enironment.
In a fresh console it returns:
.Last.value
[1] ".Random.seed" ".Last"
My use case is the classical .Last.value use case.
Sometimes I execute a long piped expression without assigning it, and after seeing the result I change mind, and would like to assign it.
I checked again.
It's a problem of running R in ESS of Emacs.
Apparently ESS runs from time to time 'ls()' in the background to update the auto completions ...
In normal R I can use .Last.value to retrieve the last value of an expression.
Doing the same with the pipe
returns something very strange. It seem to return the result of a ls() call, so a list of all variables in the current enironment.
In a fresh console it returns:
My use case is the classical .Last.value use case. Sometimes I execute a long piped expression without assigning it, and after seeing the result I change mind, and would like to assign it.