plot_curvefits
plot_curvefits( d_fit, seasons, d_obs = NULL, title = NULL, xlab = "Time", ylab = "Vegetation Index", yticks = NULL, font.size = 14, theme = NULL, cex = 2, shape = "point", angle = 30, show.legend = TRUE )
d_fit | data.frame of curve fittings returned by |
---|---|
seasons | Growing season dividing object returned by |
d_obs | data.frame of original vegetation time series, with the columns
of |
title | String, title of figure. |
xlab, ylab | String, title of |
yticks | ticks of y axis |
font.size | Font size of axis.text |
theme | ggplot theme to be applied |
cex | point size for VI observation. |
shape | the shape of input VI observation? |
angle |
|
show.legend | Boolean |
#> Error in library(phenofit): there is no package called ‘phenofit’#> Warning: data set ‘MOD13A1’ not found#> Error in tidy_MOD13(MOD13A1$dt): object 'MOD13A1' not foundst <- MOD13A1$st#> Error in eval(expr, envir, enclos): object 'MOD13A1' not founddate_start <- as.Date('2013-01-01') date_end <- as.Date('2016-12-31') sitename <- 'CA-NS6' # df$site[1] d <- df[site == sitename & (date >= date_start & date <= date_end), ]#> Error in eval(expr, envir, enclos): object 'site' not foundsp <- st[site == sitename, ]#> Error in eval(expr, envir, enclos): object 'st' not foundsouth <- sp$lat < 0#> Error in eval(expr, envir, enclos): object 'sp' not foundnptperyear <- 23 # global parameter IsPlot = TRUE print = FALSE ypeak_min = 0.05 wFUN = wTSM # add one year in head and tail # d <- add_HeadTail(d, south = south, nptperyear = nptperyear) INPUT <- check_input(d$t, d$y, d$w, QC_flag = d$QC_flag, nptperyear = nptperyear, south = south, maxgap = nptperyear/4, alpha = 0.02, wmin = 0.2)#> Error in check_input(d$t, d$y, d$w, QC_flag = d$QC_flag, nptperyear = nptperyear, south = south, maxgap = nptperyear/4, alpha = 0.02, wmin = 0.2): object 'd' not found# Rough fitting and growing season dividing brks2 <- season_mov(INPUT, rFUN = smooth_wWHIT, wFUN = wFUN, plotdat = d, IsPlot = IsPlot, IsPlot.OnlyBad = FALSE)#> Error in season_mov(INPUT, rFUN = smooth_wWHIT, wFUN = wFUN, plotdat = d, IsPlot = IsPlot, IsPlot.OnlyBad = FALSE): object 'INPUT' not found# Fine fitting fit <- curvefits( INPUT, brks2, methods = c("AG", "Beck", "Elmore", "Zhang"), #,"klos", "Gu" wFUN = wFUN, nextend = 2, maxExtendMonth = 2, minExtendMonth = 1, minPercValid = 0.2)#> Error in curvefits(INPUT, brks2, methods = c("AG", "Beck", "Elmore", "Zhang"), wFUN = wFUN, nextend = 2, maxExtendMonth = 2, minExtendMonth = 1, minPercValid = 0.2): object 'INPUT' not found#> Error in lapply(fit, get_fitting.fFITs): object 'fit' not foundg <- plot_curvefits(df_fit, brks2)#> Error in unique(.): object 'df_fit' not found#> Error in grid::grid.draw(g): object 'g' not found