mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-11-16 08:38:30 +00:00
Refine R code a little (#263)
* Replace tail(-1) with [-1] * Don't need to import utils anymore
This commit is contained in:
parent
b76ebf18bb
commit
fd125c4760
2 changed files with 2 additions and 4 deletions
|
|
@ -22,8 +22,7 @@ Imports:
|
|||
rstan (>= 2.14.0),
|
||||
scales,
|
||||
stats,
|
||||
tidyr (>= 0.6.1),
|
||||
utils
|
||||
tidyr (>= 0.6.1)
|
||||
Suggests:
|
||||
knitr,
|
||||
testthat,
|
||||
|
|
|
|||
|
|
@ -333,8 +333,7 @@ set_changepoints <- function(m) {
|
|||
# Place potential changepoints evenly through the first 80 pcnt of
|
||||
# the history.
|
||||
cp.indexes <- round(seq.int(1, floor(nrow(m$history) * .8),
|
||||
length.out = (m$n.changepoints + 1))) %>%
|
||||
utils::tail(-1)
|
||||
length.out = (m$n.changepoints + 1))[-1])
|
||||
m$changepoints <- m$history$ds[cp.indexes]
|
||||
} else {
|
||||
m$changepoints <- c()
|
||||
|
|
|
|||
Loading…
Reference in a new issue