From zhu_qifei at yahoo.com.sg  Sat Apr 18 18:34:38 2009
From: zhu_qifei at yahoo.com.sg (Qifei Zhu)
Date: Sat, 18 Apr 2009 12:34:38 -0400
Subject: [Rd] dotplot in a loop
In-Reply-To: <mailman.0.1240072187.27009.r-devel@r-project.org>
References: <mailman.0.1240072187.27009.r-devel@r-project.org>
Message-ID: <001801c9c043$92d934e0$b88b9ea0$@com.sg>

Hi all,

I'm a newbie R developer, am trying to dotplot a few graphs using a for
loop.

The following code works fine but once I wanna plot inside a loop, nothing
happens.
> for(i in 1:1){dotplot(y~x)}
> y <- c(1,2,3)
> x <- c('a','b','c')
> dotplot(y~x)

> for (i in 1:3) {dotplot(y~x)} (y and x depends on I in actual case)
Nothing happens.

I appreciate your advice on what is going wrong? Thanks.

Best,
Tony



[Rd] dotplot in a loop
Qifei Zhu