Taraxacum88 wrote:
why
rm(list=ls(all=TRUE),envir=globalenv())

is ok but

ca<-function()  rm(list=ls(all=TRUE),envir=globalenv())
ca()

does not work?

ls(all=TRUE) from within your function lists all local variables, not globals. You need envir=globalenv() there too.

Duncan Murdoch

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to