Running ‘CausalImpact_import_test.R’ [4s/6s]
  Running ‘testthat.R’ [32s/51s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # Copyright 2014 Google Inc. All rights reserved.
  > #
  > # Licensed under the Apache License, Version 2.0 (the "License");
  > # you may not use this file except in compliance with the License.
  > # You may obtain a copy of the License at
  > #
  > # http://www.apache.org/licenses/LICENSE-2.0
  > #
  > # Unless required by applicable law or agreed to in writing, software
  > # distributed under the License is distributed on an "AS IS" BASIS,
  > # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  > # See the License for the specific language governing permissions and
  > # limitations under the License.
  > 
  > # Unit test driver for the CausalImpact package.
  > #
  > # Author: kbrodersen@google.com (Kay Brodersen)
  > 
  > library(CausalImpact)
  Loading required package: bsts
  Loading required package: BoomSpikeSlab
  Loading required package: Boom
  Loading required package: MASS
  
  Attaching package: 'Boom'
  
  The following object is masked from 'package:stats':
  
      rWishart
  
  
  Attaching package: 'BoomSpikeSlab'
  
  The following object is masked from 'package:stats':
  
      knots
  
  Loading required package: zoo
  
  Attaching package: 'zoo'
  
  The following objects are masked from 'package:base':
  
      as.Date, as.Date.numeric
  
  Loading required package: xts
  
  Attaching package: 'bsts'
  
  The following object is masked from 'package:BoomSpikeSlab':
  
      SuggestBurn
  
  > library(testthat)
  > 
  > # Open graphics device and run tests
  > plot.file <- tempfile("CausalImpact", fileext = ".png")
  > png(plot.file)
  > testthat::test_check("CausalImpact")
  [1] -2
  [1] 9.1
  [1] "foo"
  [1] 100 200
  ══ Warnings ════════════════════════════════════════════════════════════════════
  ── Warning (test-impact-analysis.R:411:3): CausalImpact.RunWithData.MissingValues ──
  Results potentially inaccurate. Consider using more MCMC samples.
  Backtrace:
   1. testthat::expect_error(...) test-impact-analysis.R:411:2
   6. CausalImpact::CausalImpact(data, pre.period, post.period, model.args)
   7. CausalImpact:::RunWithData(...)
   8. CausalImpact:::ConstructModel(data.modeling, model.args)
   9. CausalImpact:::FormatInputForConstructModel(data, model.args)
  ── Warning (test-impact-analysis.R:483:3): CausalImpact.RunWithData.StandardizeData ──
  Results potentially inaccurate. Consider using more MCMC samples.
  Backtrace:
   1. CausalImpact::CausalImpact(...) test-impact-analysis.R:483:2
   2. CausalImpact:::RunWithData(...)
   3. CausalImpact:::ConstructModel(data.modeling, model.args)
   4. CausalImpact:::FormatInputForConstructModel(data, model.args)
  ── Warning (test-impact-analysis.R:488:3): CausalImpact.RunWithData.StandardizeData ──
  Results potentially inaccurate. Consider using more MCMC samples.
  Backtrace:
   1. CausalImpact::CausalImpact(...) test-impact-analysis.R:488:2
   2. CausalImpact:::RunWithData(...)
   3. CausalImpact:::ConstructModel(data.modeling, model.args)
   4. CausalImpact:::FormatInputForConstructModel(data, model.args)
  ── Warning (test-impact-analysis.R:581:3): CausalImpact.RunWithData.MissingTimePoint ──
  Results potentially inaccurate. Consider using more MCMC samples.
  Backtrace:
   1. CausalImpact::CausalImpact(...) test-impact-analysis.R:581:2
   2. CausalImpact:::RunWithData(...)
   3. CausalImpact:::ConstructModel(data.modeling, model.args)
   4. CausalImpact:::FormatInputForConstructModel(data, model.args)
  ── Warning (test-impact-analysis.R:586:3): CausalImpact.RunWithData.MissingTimePoint ──
  Results potentially inaccurate. Consider using more MCMC samples.
  Backtrace:
   1. CausalImpact::CausalImpact(...) test-impact-analysis.R:586:2
   2. CausalImpact:::RunWithData(...)
   3. CausalImpact:::ConstructModel(data.modeling, model.args)
   4. CausalImpact:::FormatInputForConstructModel(data, model.args)
  ── Warning (test-impact-inference.R:31:3): GetPosteriorStateSamples ────────────
  Results potentially inaccurate. Consider using more MCMC samples.
  Backtrace:
   1. CausalImpact:::ConstructModel(data, model.args) test-impact-inference.R:31:2
   2. CausalImpact:::FormatInputForConstructModel(data, model.args)
  ── Warning (test-impact-inference.R:46:3): ComputeResponseTrajectories ─────────
  Results potentially inaccurate. Consider using more MCMC samples.
  Backtrace:
   1. CausalImpact:::ConstructModel(data, model.args) test-impact-inference.R:46:2
   2. CausalImpact:::FormatInputForConstructModel(data, model.args)
  ── Warning (test-impact-model.R:31:3): ObservationsAreIllConditioned ───────────
  Aborting inference due to input series being all NA.
  Backtrace:
   1. testthat::expect_true(...) test-impact-model.R:31:2
   4. CausalImpact:::ObservationsAreIllConditioned(...)
  ── Warning (test-impact-model.R:36:3): ObservationsAreIllConditioned ───────────
  Aborting inference due to fewer than 3 non-NA values in input
  Backtrace:
   1. testthat::expect_true(ObservationsAreIllConditioned(c(1))) test-impact-model.R:36:2
   4. CausalImpact:::ObservationsAreIllConditioned(c(1))
  ── Warning (test-impact-model.R:37:3): ObservationsAreIllConditioned ───────────
  Aborting inference due to fewer than 3 non-NA values in input
  Backtrace:
   1. testthat::expect_true(ObservationsAreIllConditioned(c(1, 2))) test-impact-model.R:37:2
   4. CausalImpact:::ObservationsAreIllConditioned(c(1, 2))
  ── Warning (test-impact-model.R:38:3): ObservationsAreIllConditioned ───────────
  Aborting inference due to fewer than 3 non-NA values in input
  Backtrace:
   1. testthat::expect_true(ObservationsAreIllConditioned(c(1, 2, NA))) test-impact-model.R:38:2
   4. CausalImpact:::ObservationsAreIllConditioned(c(1, 2, NA))
  ── Warning (test-impact-model.R:39:3): ObservationsAreIllConditioned ───────────
  Aborting inference due to fewer than 3 non-NA values in input
  Backtrace:
   1. testthat::expect_true(...) test-impact-model.R:39:2
   4. CausalImpact:::ObservationsAreIllConditioned(c(NA, 1, 2, NA))
  ── Warning (test-impact-model.R:40:3): ObservationsAreIllConditioned ───────────
  Aborting inference due to fewer than 3 non-NA values in input
  Backtrace:
   1. testthat::expect_true(...) test-impact-model.R:40:2
   4. CausalImpact:::ObservationsAreIllConditioned(...)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure (test-impact-misc.R:199:3): StandardizeAllVariables ─────────────────
  result$UnStandardize not equal to Standardize(data[, 1])$UnStandardize.
  Component "fit.range": Mean relative difference: 0.1980198
  Component "y": Mean relative difference: 0.006418538
  Component "y.fit": Attributes: < Component "index": Numeric: lengths (80, 100) differ >
  Component "y.fit": Numeric: lengths (80, 100) differ
  Component "y.mu": Mean relative difference: 0.0003311222
  Component "y.sd": Mean relative difference: 0.00520746
  ── Failure (test-impact-misc.R:216:3): StandardizeAllVariables ─────────────────
  result$UnStandardize not equal to Standardize(data)$UnStandardize.
  Component "fit.range": Mean relative difference: 0.1980198
  Component "y": Mean relative difference: 0.006418538
  Component "y.fit": Attributes: < Component "index": Numeric: lengths (80, 100) differ >
  Component "y.fit": Numeric: lengths (80, 100) differ
  Component "y.mu": Mean relative difference: 0.0003311222
  Component "y.sd": Mean relative difference: 0.00520746
  ── Failure (test-impact-plot.R:124:3): CreateImpactPlot ────────────────────────
  `q1` not equal to `q2`.
  Component "layers": Component 1: Component 11: Component 1: target is not list-like
  Component "layers": Component 2: Component 11: Component 1: target is not list-like
  Component "layers": Component 3: Component 11: Component 1: target is not list-like
  Component "layers": Component 4: Component 11: Component 1: target is not list-like
  Component "layers": Component 5: Component 11: Component 1: target is not list-like
  Component "scales": Component "super": Component "...": target is not list-like
  Component "scales": Component "super": Component "env": Component "self": Component "super": Component "...": target is not list-like
  Component "scales": Component "super": Component "env": Component "self": Component "super": Component "env": Component "self": Component "super": Component "...": target is not list-like
  Component "scales": Component "super": Component "env": Component "self": Component "super": Component "env": Component "self": Component "super": Component "env": Component "self": Component "super": Component "...": target is not list-like
  ...
  ── Failure (test-impact-plot.R:130:3): CreateImpactPlot ────────────────────────
  `q1` not equal to `q2`.
  Component "layers": Component 1: Component 11: Component 1: target is not list-like
  Component "layers": Component 2: Component 11: Component 1: target is not list-like
  Component "layers": Component 3: Component 11: Component 1: target is not list-like
  Component "layers": Component 4: Component 11: Component 1: target is not list-like
  Component "layers": Component 5: Component 11: Component 1: target is not list-like
  Component "scales": Component "super": Component "...": target is not list-like
  Component "scales": Component "super": Component "env": Component "self": Component "super": Component "...": target is not list-like
  Component "scales": Component "super": Component "env": Component "self": Component "super": Component "env": Component "self": Component "super": Component "...": target is not list-like
  Component "scales": Component "super": Component "env": Component "self": Component "super": Component "env": Component "self": Component "super": Component "env": Component "self": Component "super": Component "...": target is not list-like
  ...
  ── Failure (test-impact-plot.R:142:3): CreateImpactPlot ────────────────────────
  `q1` not equal to `q3`.
  Component "layers": Component 1: Component 11: Component 1: target is not list-like
  Component "layers": Component 2: Component 11: Component 1: target is not list-like
  Component "layers": Component 3: Component 11: Component 1: target is not list-like
  Component "layers": Component 4: Component 11: Component 1: target is not list-like
  Component "layers": Component 5: Component 11: Component 1: target is not list-like
  Component "scales": Component "super": Component "...": target is not list-like
  Component "scales": Component "super": Component "env": Component "self": Component "super": Component "...": target is not list-like
  Component "scales": Component "super": Component "env": Component "self": Component "super": Component "env": Component "self": Component "super": Component "...": target is not list-like
  Component "scales": Component "super": Component "env": Component "self": Component "super": Component "env": Component "self": Component "super": Component "env": Component "self": Component "super": Component "...": target is not list-like
  ...
  
  [ FAIL 5 | WARN 13 | SKIP 0 | PASS 718 ]
  Error: Test failures
  Execution halted