Hello:

I am using R 2.10.1  I am trying to make multiple scatter plots with ggplot2, 
using a for loop to select
only certain entries in a dataframe.  Here is my code:

for(i in 1:length(ganges_subbasin[,1] )){



    subbasin_select <- as.character(ganges_subbasin[i, 2])

    #print(subbasin_select)

    subbasin_select <- as.character(ganges_subbasin[i, 2])

    p <- ggplot(ganges_subbasin_a2pre_sort ,aes(x = Month, y = med, ymin
= min, ymax = max, subset = CATCHMENT_ == subbasin_select)) +
ylab("Precipitation (mm)\n") + opts(title = paste("Projected
Precipitation 2030 - 2049 (Sub-Basin ", subbasin_select, ")\n", sep =
"")) + scale_colour_grey()


    p +  geom_pointrange(linetype = 2, colour = "navyblue") +
opts(axis.text.x = theme_text(colour = "black")) + opts(axis.text.y =
theme_text(colour = "black"))  +  opts(axis.ticks =
theme_segment(colour = "white"))


    ggsave(paste(subbasin_select,"2100.jpeg", sep = " "))



}

dev.off()

Unfortunately, I get this error:

"Saving 6.95" x 6.94" image
Error in grDevices::jpeg(..., width = width, height = height, res =
dpi,  :
  unable to start device
In addition: Warning messages:
1: In grDevices::jpeg(..., width = width, height = height, res =
dpi,  :
  Unable to allocate bitmap
2: In grDevices::jpeg(..., width = width, height = height, res =
dpi,  :
  opening device failed
>
"

Any suggestions?

Thank you.

Michael


      
        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to