Re: [R] remove empty objects from workspace

2009-05-19 Thread Henrique Dallazuanna
Try this also: rm(list=names(which(unlist(eapply(globalenv(), function(a)all(is.na(a) || is.null(a))) On Tue, May 19, 2009 at 9:07 AM, Katharina May wrote: > Thanks Jim, the removal of objects which are NA works perfectly! > > For my second problem it didn't express myself correctly: > I

Re: [R] remove empty objects from workspace

2009-05-19 Thread Katharina May
Thanks Jim, the removal of objects which are NA works perfectly! For my second problem it didn't express myself correctly: I actually meant objects with rows (attributes?) but no data in it but I solved this adjusting your approach: for(object in objects()) if(is.null(dim(get(object))[1]) || dim

Re: [R] remove empty objects from workspace

2009-05-19 Thread Jim Lemon
Katharina May wrote: Hi, how can I remove all empty objects (which are NA or have zero rows) from my workspace? Hi Katharina, To remove objects that are all NA: for(object in objects()) if(all(is.na(get(object rm(list=object) If by "zero rows" you mean objects that do not have a dimen

[R] remove empty objects from workspace

2009-05-19 Thread Katharina May
Hi, how can I remove all empty objects (which are NA or have zero rows) from my workspace? Thanks, Katharina __ 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.o