Re: [R] Why is bubbles() creating empty png graphs?

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Thu 15 Dec 2005 - 23:01:14 EST

Is this bubble() from gstat?

FAQ, Q7.22 On Thu, 15 Dec 2005, Rainer M Krug wrote:

> This code below produces empty XXX.png files - if I use plot(), it works
> and if I enter the commands
>
> png(filename=fn)
> bubble(positions, do.sqrt=FALSE, main=q)
> dev.off()
>
> manually, it works as well.
>
> I am lost - any help appreciated.
>
> The weird thing is that it worked before I made some changes... (I don't
> have a copy of the working version...).
>
> R version:
>
> platform i686-pc-linux-gnu
> arch i686
> os linux-gnu
> system i686, linux-gnu
> status
> major 2
> minor 2.0
> year 2005
> month 10
> day 06
> svn rev 35749
> language R
>
> Operating system: SuSE 10
>
> Rainer
>
>
> -----------------
>
> library(gstat)
> library(RMySQL)
> library(DAAG)
>
> m <- dbDriver("MySQL")
> con <- dbConnect(m, group = "renpatch_renosterbos")
>
> tbls <- dbListTables(con)
> runs <- 1:5
> years <- seq(98, 0, -7)
>
> progress_end <- length(tbls) * length(runs) * length(years)
> progress <- 0
>
> for (year in years)
> {
> fd <- paste("/home/rkrug/Documents/R/plots/Y", year, sep="")
> dir.create(fd, showWarnings=FALSE, recursive = TRUE)
> for (run in runs)
> {
> for (tn in tbls)
> {
> fn <- paste(fd, "/", tn, "_R", run, "_Y", year, ".png", sep="")
> progress <- progress + 1
> cat(progress, 'of', progress_end, " | ", fn, " | ")
> flush.console()
> if (!file.exists(fn))
> {
> q <- paste("select X,Y,RX from", tn, "where (_run=", run, ") AND
> (_Year=", year, ")")
> rs <- dbSendQuery(con, q)
> positions <- fetch(rs, n = -1)
> while (!dbHasCompleted(rs))
> {
> cat(".")
> flush.console()
> }
> cat(length(positions$X), "points")
> png(filename=fn)
> bubble(positions, do.sqrt=FALSE, main=q)
> #plot(positions)
> dev.off()
> pause()
> cat(" | Done \n")
> }
> }
> }
> }
>
> --
> --
> Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation Biology (UCT)
>
> Department of Conservation Ecology
> University of Stellenbosch
> Matieland 7602
> South Africa
>
> Tel: +27 - (0)72 808 2975 (w)
> Fax: +27 - (0)21 808 3304
> Cell: +27 - (0)83 9479 042
>
> email: RKrug@sun.ac.za
> Rainer@krugs.de
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Thu Dec 15 23:23:51 2005

This archive was generated by hypermail 2.1.8 : Fri 16 Dec 2005 - 02:33:04 EST