How to convert a panel dataset to a multi-layer raster in R?

55 Views Asked by At

I wish to use the R package greenbrown to calculate phenology metrics such as Start of Season (SOS) or End of Season (EOS) of Kenya from NDVI values. I already have a panel dataset which includes one datapoint for each 0.5 x 0.5 degrees grid cell for each 16 days since the year 2000 and it looks like the following.

cell_id lon lat date year month day period mean median
1 33.31259 -4.76495 06apr2000 2000 4 6 7 5934.126 5990.774
1 33.31259 -4.76495 22apr2000 2000 4 22 8 5648.910 5652.855

Now as far as I know, I need a object of the class brick (i.e., a multi-layer raster object) to use the greenbrown function PhenologyRaster. However, I have no experience in converting this dataframe into a multi-layer raster object and wasn't able to resolve my issue online.

0

There are 0 best solutions below