[R] calling bwplot within a for loop

Deepayan Sarkar deepayan at stat.wisc.edu
Mon Mar 22 19:21:14 CET 2004


On Monday 22 March 2004 11:55, Steven Lacey wrote:
> Hi,
>
>
>
> I am working with R 1.81. When I call bwplot() it prints the output
> to the windows device as it should. For example,
>
>
>
> d<-data.frame(y=c(2,3,4,5,12,14,16,11),x=c(rep("group1",4),rep("group
>2",4)))
>
> bwplot(y~x,data=d)
>
>
>
> This code results in a parallel boxplot. That is a single plot with 2
> boxplots next to each other; a boxplot for "group1" and a boxplot for
> "group2".
>
>
>
> However, if I call bwplot within a loop, the window device appears
> but nothing is plotted.
>
>
>
> for(i in c(1)){
>
>     print(i)
>
>     bwplot(y~x,data=d)

Replace this by 

      print(bwplot(y~x,data=d))

> }
>
>
>
> Does anyone know why this is happening and how to solve it?
>
>
>
> Thanks,
> Steve
>
>
>
>
>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html




More information about the R-help mailing list