简体   繁体   English

R中的多个栅格箱图

[英]Multiple Raster Boxplots in R

I am trying to make a figure that has a boxplot for 14 different rasters. 我正在尝试制作一个具有针对14种不同栅格的箱线图的图形。 Each raster represents the snow depth surface for a given 100m elevation band, from 1300-2600 masl. 每个栅格代表给定100m高程带(1300-2600 masl)的雪深表面。 I know how to make a boxplot for each raster individually, but cannot figure out how to get all 14 onto the same figure. 我知道如何分别为每个栅格绘制箱形图,但无法弄清楚如何将所有14个栅格绘制到同一图形上。 It would be ideal to skip converting the rasters to ASCII grids as has been previously suggested to me. 如先前向我建议的那样,最好跳过将栅格转换为ASCII网格的操作。 Any help is much appreciated! 任何帮助深表感谢!

You can do 你可以做

r1 = raster(vals=rnorm(100,2), ncols=10, nrows=10)
r2 = raster(vals=rnorm(100,5,2), ncols=10, nrows=10)
r3 = raster(vals=rnorm(100,4), ncols=10, nrows=10)
boxplot(data.frame(r1=values(r1), r2=values(r2), r3=values(r3)))

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM