[R] Welcome to the "R-help" mailing list

Uwe Ligges ligges at statistik.tu-dortmund.de
Sat Apr 18 19:38:52 CEST 2009



Qifei Zhu 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.


dotplot is a lattice function that need to be print()-ed which happened 
before automatically (as you'd type x in it is printed).


Uwe Ligges


> I appreciate your advice on what is going wrong? Thanks.
> 
> Best,
> Tony
> 
> ______________________________________________
> R-help at 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.




More information about the R-help mailing list