Running ‘test_generate.R’ [3s/4s]
Running the tests in ‘tests/test_generate.R’ failed.
Complete output:
  > # This is a test script for RGENERATE::generate function
  > # 
  > # Author: Emanuele Cordano
  > ###############################################################################
  > rm(list=ls())
  > 
  > ## TESTING R CODE: 
  > library(testthat)
  > context("Verfiy RGENERATE::generate example output")
  > 
  > library(RGENERATE)
  Loading required package: RMAWGEN
  Loading required package: chron
  Loading required package: date
  Loading required package: vars
  Loading required package: MASS
  Loading required package: strucchange
  Loading required package: zoo
  
  Attaching package: 'zoo'
  
  The following objects are masked from 'package:base':
  
      as.Date, as.Date.numeric
  
  Loading required package: sandwich
  Loading required package: urca
  Loading required package: lmtest
  Loading required package: magrittr
  
  Attaching package: 'magrittr'
  
  The following objects are masked from 'package:testthat':
  
      equals, is_less_than, not
  
  > 
  > 
  > write_test_outcomes=FALSE
  > ##test_outcomes=!write_test_outcomes
  > 
  > seed = 122
  > set.seed(seed)
  > NSTEP <- 1000
  > x <- rnorm(NSTEP)
  > y <- x+rnorm(NSTEP)
  > z <- c(rnorm(1),y[-1]+rnorm(NSTEP-1))
  > df <- data.frame(x=x,y=y,z=z)
  > var <- VAR(df,type="none")
  > gg <- generate(var,n=20) 
  > if (write_test_outcomes)  saveRDS(gg,file="/home/ecor/local/rpackages/rendena100/RGENERATE/inst/outcomes/gg.rds")
  > ggo <- readRDS(system.file("outcomes/gg.rds",package="RGENERATE")) 
  > 
  > ##ggo <- data.frame(x=1:10,y=0,z=0)
  > ##
  > test_that(desc="Testing generate.varest",code=expect_equal(gg,ggo, tolerance = .002, scale = 1))
  Test passed with 1 success 🌈.
  > ##
  > 
  > ##stop("QUI")
  > cov <- cov(gg)
  > set.seed(seed)
  > ggg <- generate(FUN=rnorm,n=NSTEP,cov=cov)
  > if (write_test_outcomes)  saveRDS(ggg,file="/home/ecor/local/rpackages/rendena100/RGENERATE/inst/outcomes/ggg.rds")
  > gggo <- readRDS(system.file("outcomes/ggg.rds",package="RGENERATE")) 
  > 
  > test_that(desc="Testing generate.default",code=expect_equal(ggg,gggo, tolerance = .002, scale = 1))
  Test passed with 1 success 😸.
  > 
  > ##test_that(desc="Testing generate.varest",code=expect_equal(test,test0, tolerance = .002, scale = 1))
  > ##stop("QUI")
  > 
  > library(RMAWGEN)
  > ####
  > exogen <- as.data.frame(x+5)
  > set.seed(seed)
  > gpcavar <- getVARmodel(data=df,suffix=NULL,p=3,n_GPCA_iteration=5,
  +                        n_GPCA_iteration_residuals=5,exogen=exogen)
  Warning message:
  In VAR(y = data_for_var, p = p, type = type, season = season, exogen = exogen,  :*** buffer overflow detected ***: terminated
  Aborted