[R] simple for loop
Liaw, Andy
andy_liaw at merck.com
Sat Nov 16 02:34:28 CET 2002
Try this inside your loop:
if (dim(get(i))[1] == 0) rm(list=i)
HTH,
Andy
-----Original Message-----
From: Stephan Holl [mailto:sholl at gmx.net]
Sent: Friday, November 15, 2002 5:31 PM
To: r-help at stat.math.ethz.ch
Subject: [R] simple for loop
Dear list.
I cannot manage to select all data.frames, which have no data inside.
names <- c("data.fame1", "data.fame2","data.fame4","data.fame4")
for (i in names)
{
ifelse(dim(i)[1]==0, rm(i))
}
perhaps anybody could help
thank you.
--
Stephan Holl
GnuPG Key-ID: 11946A09
ICQ# 117277975
------------------------------------------------------------------------------
Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that may be confidential, proprietary copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please immediately return this by e-mail and then delete it.
==============================================================================
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list