mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-11-18 08:53:42 +00:00
Fix failure with dplyr 1.0.0
I'm not sure why a data frame ends up with names and a tibble does not, but it doesn't seem like an important enough problem to investigate in detail, and this is a simple fix.
This commit is contained in:
parent
25e2b88765
commit
cded5c41b0
1 changed files with 3 additions and 2 deletions
|
|
@ -6,12 +6,12 @@
|
||||||
library(prophet)
|
library(prophet)
|
||||||
context("Prophet tests")
|
context("Prophet tests")
|
||||||
|
|
||||||
DATA <- read.csv('data.csv')
|
DATA <- read.csv(test_path('data.csv'))
|
||||||
N <- nrow(DATA)
|
N <- nrow(DATA)
|
||||||
train <- DATA[1:floor(N / 2), ]
|
train <- DATA[1:floor(N / 2), ]
|
||||||
future <- DATA[(ceiling(N/2) + 1):N, ]
|
future <- DATA[(ceiling(N/2) + 1):N, ]
|
||||||
|
|
||||||
DATA2 <- read.csv('data2.csv')
|
DATA2 <- read.csv(test_path('data2.csv'))
|
||||||
|
|
||||||
DATA$ds <- prophet:::set_date(DATA$ds)
|
DATA$ds <- prophet:::set_date(DATA$ds)
|
||||||
DATA2$ds <- prophet:::set_date(DATA2$ds)
|
DATA2$ds <- prophet:::set_date(DATA2$ds)
|
||||||
|
|
@ -623,6 +623,7 @@ test_that("conditional_custom_seasonality", {
|
||||||
out <- prophet:::make_all_seasonality_features(m, df)
|
out <- prophet:::make_all_seasonality_features(m, df)
|
||||||
#Confirm that only values without is_conditional_week has non zero entries
|
#Confirm that only values without is_conditional_week has non zero entries
|
||||||
nonzero.weekly = out$seasonal.features %>%
|
nonzero.weekly = out$seasonal.features %>%
|
||||||
|
dplyr::as_tibble() %>%
|
||||||
dplyr::select(dplyr::starts_with('conditional_weekly')) %>%
|
dplyr::select(dplyr::starts_with('conditional_weekly')) %>%
|
||||||
dplyr::mutate_all(~ . != 0) %>%
|
dplyr::mutate_all(~ . != 0) %>%
|
||||||
dplyr::mutate(nonzero = rowSums(. != 0) > 0) %>%
|
dplyr::mutate(nonzero = rowSums(. != 0) > 0) %>%
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue