plot_curvefits: plot_curvefits

Description Usage Arguments Examples

View source: R/plot_curvefits.R

Description

plot_curvefits

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
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,
  layer_extra = NULL,
  ...
)

Arguments

d_fit

data.frame of curve fittings returned by get_fitting().

seasons

Growing season dividing object returned by season() and season_mov().

d_obs

data.frame of original vegetation time series, with the columns of t, y and QC_flag. If not specified, it will be determined from d_fit.

title

String, title of figure.

xlab, ylab

String, title of xlab and ylab.

yticks

ticks of y axis

font.size

Font size of axis.text

theme

ggplot theme

cex

point size for VI observation.

shape

the shape of input VI observation? line or point

angle

text.x angle

show.legend

Boolean

layer_extra

(not used) extra ggplot layers

...

ignored

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
data("CA_NS6")
d = CA_NS6

nptperyear <- 23
INPUT <- check_input(d$t, d$y, d$w, QC_flag = d$QC_flag,
     nptperyear = nptperyear, south = FALSE,
     maxgap = nptperyear/4, alpha = 0.02, wmin = 0.2)
# plot_input(INPUT)

# Rough fitting and growing season dividing
wFUN <- "wTSM"
brks2 <- season_mov(INPUT,
    options = list(
        rFUN = smooth_wWHIT, wFUN = wFUN,
        r_min = 0.05, ypeak_min = 0.05,
        lambda = 10,
        verbose = FALSE
    ))
# plot_season(INPUT, brks2, d)
# Fine fitting
fit <- curvefits(
    INPUT, brks2,
    options = list(
        methods = c("AG", "Beck", "Elmore", "Zhang"), #,"klos", "Gu"
        wFUN = wFUN,
        nextend = 2, maxExtendMonth = 2, minExtendMonth = 1, minPercValid = 0.2
    )
)

r_param = get_param(fit)
r_pheno = get_pheno(fit)
r_gof = get_GOF(fit)
d_fit = get_fitting(fit)

g <- plot_curvefits(d_fit, brks2)
grid::grid.newpage(); grid::grid.draw(g)

phenofit documentation built on Oct. 15, 2021, 5:09 p.m.