我尝试使用ggplot
和sp
生成一些地图,我有一个原始大小为3000+ x 3000+
像素的底图,我也有一些2000+ x 2000+
像素。有趣的是,直到现在我还是无法创建3000+ x 3000+
像素的png文件,因为R给了我以下错误:
Error in png(chart.filename, width = basemap.xlength, height = basemap.ylength, :
unable to start png() device
In addition: Warning messages:
1: In png(chart.filename, width = basemap.xlength, height = basemap.ylength, :
Unable to allocate bitmap
2: In png(chart.filename, width = basemap.xlength, height = basemap.ylength, :
opening device failed
这是对R的限制吗?我可以如何度过难关?感谢。
我正在使用Win7和R 2.15.0。
答案 0 :(得分:3)
Unable to allocate bitmap
建议您遇到内存问题,因此我会尝试使用较小的分配,提供有关系统的详细信息以及一些可重现的代码。
你所描述的对我有用 - 虽然我不建议实际运行它,因为它会创建一个非常浪费的文件:
png("a.png", width = 3000, height = 3000)
image(matrix(rnorm(3000*3000), 3000), useRaster = TRUE)
dev.off()