Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Capture last output as an R object [duplicate]

Tags:

r

ess

Possible Duplicate:
How to assign the result of the previous expression to a variable in R?

I'm working with R in ESS and just made the stupid mistake of running a long running function without assigning the result to a variable. So, it just printed out the result, a long string of output that looks like:

[[1]]
1 FALSE
[[2]]
1 TRUE
[[3]]
1 TRUE
[[4]]
1 TRUE 

Is there any way to coerce this printed output into an R object? Either within R, or using emacs (M-x undo-my-stupid-mistake)?

like image 533
Wilduck Avatar asked Jan 04 '12 23:01

Wilduck


1 Answers

Maybe this will work:

out <- .Last.value
like image 50
Pierre Lapointe Avatar answered Oct 19 '22 12:10

Pierre Lapointe