Skip to content
Prev 31098 / 398513 Next

"export" an object froma function for access by ls()

I struggle with this very simple problem:

ls()
(empty)

giveval <- function() {
	x <- foo
	eval (x, envir=parent.frame(1))
}

ls()
(still empty)

I did not find anything more promising than eval for this purpose, but how 
only can I make it to have ls() return x?

David