Skip to content

Commit

Permalink
minor update: fix cran notes
Browse files Browse the repository at this point in the history
  • Loading branch information
kongdd committed Jan 23, 2024
1 parent 5c4d7f3 commit 57b4943
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 18 deletions.
3 changes: 1 addition & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: phenofit
Type: Package
Title: Extract Remote Sensing Vegetation Phenology
Version: 0.3.8
Version: 0.3.9
Authors@R: c(
person("Dongdong", "Kong", role = c("aut", "cre"), email = "[email protected]"),
person("Mingzhong", "Xiao", role = c("aut"), email = "[email protected]"),
Expand Down Expand Up @@ -55,7 +55,6 @@ Imports:
Suggests:
knitr,
rmarkdown,
reshape2, spam,
testthat (>= 2.1.0)
URL: https://github.com/eco-hydro/phenofit
BugReports: https://github.com/eco-hydro/phenofit/issues
Expand Down
7 changes: 4 additions & 3 deletions R/examples/ex-opt_FUN.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ library(phenofit)
library(ggplot2)
library(magrittr)
library(purrr)
library(data.table)

# simulate vegetation time-series
fFUN = doubleLog_Beck
Expand All @@ -21,9 +22,9 @@ opts <- lapply(optFUNs, function(optFUN){
})

# visualization
df <- map(opts, "ysim") %>% as.data.frame() %>% cbind(t, y, .)
pdat <- reshape2::melt(df, c("t", "y"), variable.name = "optFUN")
df <- map(opts, "ysim") %>% as.data.table() %>% cbind(t, y, .)
pdat <- data.table::melt(df, c("t", "y"), variable.name = "optFUN")

ggplot(pdat) +
geom_point(data = data.frame(t, y), aes(t, y), size = 2) +
geom_line(aes(t, value, color = optFUN), size = 0.9)
geom_line(aes(t, value, color = optFUN), linewidth = 0.9)
4 changes: 2 additions & 2 deletions R/process_season.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#' divide_seasons
#'
#' @inheritParams check_input
#' @param d data.frame, with the columns of `t`, `y` and `w`.
#' @param options_season options of [season_mov()]
#' @param d_obs data.frame, with the columns of `t`, `y` and `w`.
#' @param options options of [season_mov()]
#'
#' @note site-year may be not continuous.
#'
Expand Down
8 changes: 4 additions & 4 deletions R/season_mov.R
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,12 @@ season_mov <- function(INPUT,
brk$dt %<>% subset(year == year_i) %>% mutate(lambda = lambda)

# improve for head and tail, v0.3.4
if (i == 1) {
rfit = brk$fit[date_year[I] <= year_i, ]
rfit = if (i == 1) {
brk$fit[date_year[I] <= year_i, ]
} else if (i == length(years.run)) {
rfit = brk$fit[date_year[I] >= year_i, ]
brk$fit[date_year[I] >= year_i, ]
} else {
rfit = brk$fit[date_year[I] == year_i, ]
brk$fit[date_year[I] == year_i, ]
}
ans = list(fit = rfit, dt = brk$dt)
if (.options$debug) ans %<>% c(list(fit.raw = brk$fit), .)
Expand Down
7 changes: 4 additions & 3 deletions man/opt_FUN.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/process_season.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 57b4943

Please sign in to comment.