It works. Thanks! -----Original Message----- From: mike.lw...@gmail.com [mailto:mike.lw...@gmail.com] On Behalf Of Mike Lawrence Sent: Saturday, April 18, 2009 1:30 PM To: Qifei Zhu Cc: r-help@r-project.org Subject: Re: [R] Welcome to the "R-help" mailing list
When plotting in loops, you need to wrap your plot call in print(). On Sat, Apr 18, 2009 at 2:14 PM, Qifei Zhu <zhu_qi...@yahoo.com.sg> wrote: > 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 > > ______________________________________________ > 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. > -- Mike Lawrence Graduate Student Department of Psychology Dalhousie University Looking to arrange a meeting? Check my public calendar: http://tr.im/mikes_public_calendar ~ Certainty is folly... I think. ~ ______________________________________________ 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.