Skip to content
Prev 199278 / 398503 Next

rm(list<-ls()) error

Feng Li wrote:
Yes, and it means that you make an assignment once passed to the first 
argument "..." in rm() and evaluated. Well, it is just never evaluated 
since "..." needs to be a name or a character vector (and is a language 
object in this case), hence an error in rm().

You can do:

rm(list=(list <- ls()))

of course, which does what you are intending, I guess: assigns the ls() 
to list and removes all objects given in list, since list is passed to 
the argument list.

Uwe Ligges