[R] Plotting device does not show all graphs

Sarah Goslee sarah.goslee at gmail.com
Thu May 26 17:47:14 CEST 2011


Well, when I try to run your sample code, I get one figure and a bunch
of error messages.

How about an actual executable example and the requested basic
information on your OS, version of R, etc? That would make it a lot
easier to offer useful suggestions (by which I mean possible).

> d=data.frame(age=rnorm(100,40,8),ht=rnorm(100,170,15))
>
> tiff(file=paste("test","%03d",".tif",sep=""))
>
> hist.data.frame(d)
Error: could not find function "hist.data.frame"
>
> datadensity(d)
Error: could not find function "datadensity"
>
> par(mfrow=c(1,2),mar=c(3,3,3,3))
>
> boxplot(d$age)
>
> hist(age)
Error in hist(age) : object 'age' not found
>
> dev.off()
null device
          1

I get a boxplot only.

Can you actually run this code without error messages? Even if you
have loaded whatever library the missing plot functions came from,
hist(age) is not going to create a plot, thus you would only ever get
three files.

Sarah

On Thu, May 26, 2011 at 11:23 AM, John S <john.smithr75 at gmail.com> wrote:
> Dear All,
>
> I am creating 4 plots (files) but I could see only 3. Here is a simple code
>
>  d=data.frame(age=rnorm(100,40,8),ht=rnorm(100,170,15))
>
> tiff(file=paste("test","%03d",".tif",sep=""))
>
> hist.data.frame(d)
>
> datadensity(d)
>
> par(mfrow=c(1,2),mar=c(3,3,3,3))
>
> boxplot(d$age)
>
> hist(age)
>
> dev.off()
>
>
>
> PDF works fine but png and tiff seems to miss the second graph. I must be
> missing something
> Thanks!!!


-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list