It's the png file. It seems to be writing the first data set over and over to the various png files.
________________________________ From: Michael Sumner [mdsum...@gmail.com] Sent: Tuesday, March 05, 2013 2:41 PM To: Hodgess, Erin Cc: r-sig-geo@r-project.org Subject: Re: [R-sig-Geo] question about image function I don't see filename defined, or any packages required. Is it the png files that are a problem or the 'kmlsetup' output? (whatever that is) See the animation package for extremely simplifed image frame creation btw On Wednesday, March 6, 2013, Hodgess, Erin wrote: Hello again! I'm running into a problem with the image function within a loop. When I put it to the screen, it works fine, but when I put it to a PNG file, the picture doesn't change. Here is the code: for(i in 1:11) { j1 <- (i-1)*n2 + 1 j2 <- i*n2 predx <- data.frame(pred=kr3$var1.pred[j1:j2],lon=kr3@sp@coords[,1],lat=kr3@sp@coords[,2]) coordinates(predx) <- ~lon+lat proj4string(predx) <- proj4string(kr3) predx.wgs84 <- spTransform(predx,CRS("+proj=longlat +datum=WGS84")) llSPix <- as(llSGDF, "SpatialPixelsDataFrame") (st <- system.time(llSPix$pred <- idw(pred ~ 1, loc=predx.wgs84,newdata = llSPix, nmax = 16)$var1.pred)) cat("stuff",i,"\n") f1 <- paste("pred",i,"a.png",sep="") #Works fine image(llSPix,"pred",col=bpy.colors(),main=f1) assign("file1",f1) cat("filen",file1,"\n") png(filename = file1, width = GRD.wgs84$width, height = GRD.wgs84$height,bg="transparent") par(mar = c(0, 0, 0, 0), xaxs = "i", yaxs = "i") image(llSPix, "pred", col = bpy.colors()) dev.off() kmlsetup(obj = GRD.wgs84, kmlfile =filename, imagefile = file1, name =as.character(2000+i)) } Has anyone run into this before, please? Thanks, Erin [[alternative HTML version deleted]] _______________________________________________ R-sig-Geo mailing list R-sig-Geo@r-project.org<UrlBlockedError.aspx> https://stat.ethz.ch/mailman/listinfo/r-sig-geo -- Michael Sumner Hobart, Australia e-mail: mdsum...@gmail.com<mailto:mdsum...@gmail.com> [[alternative HTML version deleted]] _______________________________________________ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo