我给自己买了一个名为 y 的光栅砖,它有 14 975 个时间层,因为它从 1979 年 1 月 1 日到 2019 年 12 月 31 日(14 975 天)每天都有每日平均位势高度值。砖有以下描述:
class : RasterBrick
dimensions : 221, 121, 26741, 14975 (nrow, ncol, ncell, nlayers)
resolution : 0.25, 0.25 (x, y)
extent : 14.875, 45.125, 24.875, 80.125 (xmin, xmax, ymin, ymax)
crs : +proj=longlat +datum=WGS84
source : C:/Users/Adam/AppData/Local/Temp/RtmpaKZVdb/raster/r_tmp_2020-10-26_165849_53084_29346.grd
names : index_1979.01.01, index_1979.01.02, index_1979.01.03, index_1979.01.04, index_1979.01.05, index_1979.01.06, index_1979.01.07, index_1979.01.08, index_1979.01.09, index_1979.01.10, index_1979.01.11, index_1979.01.12, index_1979.01.13, index_1979.01.14, index_1979.01.15, ...
min values : 46604.85, 47328.07, 48944.12, 49320.65, 49244.67, 49516.16, 49504.01, 48959.65, 48608.90, 47603.10, 47572.72, 48564.15, 49816.92, 49078.65, 48321.72, ...
max values : 57006.81, 56968.60, 56958.67, 56976.26, 57288.55, 57535.62, 57659.48, 57581.33, 57381.65, 57052.99, 56803.95, 56854.89, 56783.50, 56739.44, 56600.52, ...
我想按月将这个 rasterbrick 分成 12 个 rasterbrick,这样我每个日历月就有 1 个 rasterbrick。我尝试了几种方法,但都没有奏效。例如,我尝试从名称(y)中减去月份字符,我认为这绝对是要走的路,但它根本行不通。每一个帮助表示赞赏,谢谢!