Re: [R] Clear all with/without function()

2009-04-08 Thread Duncan Murdoch
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

Re: [R] Clear all with/without function()

2009-04-08 Thread baptiste auguie
clr <- function () rm(list = ls(pos = .GlobalEnv), pos = .GlobalEnv) this works for me HTH, baptiste On 8 Apr 2009, at 10:50, 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? Thank yo

[R] Clear all with/without function()

2009-04-08 Thread Taraxacum88
why rm(list=ls(all=TRUE),envir=globalenv()) is ok but ca<-function() rm(list=ls(all=TRUE),envir=globalenv()) ca() does not work? Thank you! v -- View this message in context: http://www.nabble.com/Clear-all-with-without-function%28%29-tp22947021p22947021.html Sent from the R help mailin