物候数据使用说明

## post-process
library(grid)
library(matrixStats)
library(lubridate)

fill_grid <- function(grid, d){
    ngrid <- nrow(grid)
    ncol  <- ncol(d)
    I <- match(seq_len(ngrid), d$row)

    grid@data <- d[I, 1:(ncol-1)] %>% data.frame()
    grid
}

file_pheno_012 <- "OUTPUT/phenology_TP_AVHRR_phenofit.rda"
# file_pheno_010 <- "OUTPUT/phenology_TP_AVHRR_phenofit_010deg.rda"

# MAIN script ------------------------------------------------------------------
load("data/00basement_TP.rda")
load(file_pheno_012)

d <- df_pheno[year(origin) == 2002, -(1:2)]
gridclip2 <- fill_grid(gridclip, d)
spplot(gridclip2)

Add a new chunk by clicking the Insert Chunk button on the toolbar or by pressing Ctrl+Alt+I.

When you save the notebook, an HTML file containing the code and output will be saved alongside it (click the Preview button or press Ctrl+Shift+K to preview the HTML file).

The preview shows you a rendered HTML copy of the contents of the editor. Consequently, unlike Knit, Preview does not run any R code chunks. Instead, the output of the chunk when it was last run in the editor is displayed.



kongdd/phenology_TP documentation built on Jan. 15, 2022, 12:18 p.m.