Running examples in 'argo-Ex.R' failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: summary_argo
> ### Title: performance summary of ARGO applied on CDC's ILI data
> ### Aliases: summary_argo
> 
> ### ** Examples
> 
> GFT_xts = xts::xts(exp(matrix(rnorm(1000), ncol=10)), order.by = Sys.Date() - (100:1))
> names(GFT_xts) <- paste0("col", 1:10)
> names(GFT_xts)[1] <- "CDC.data"
> summary_argo(
+   GFT_xts = GFT_xts,
+   model_names = colnames(GFT_xts)[-1],
+   legend_names = paste0(colnames(GFT_xts)[-1], "legend"),
+   periods = c(paste0(zoo::index(GFT_xts)[1], "/", zoo::index(GFT_xts)[49]),
+               paste0(zoo::index(GFT_xts)[50], "/", zoo::index(GFT_xts)[100])),
+   whole_period="2009-03/"
+ )
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
argo
 --- call from context --- 
FUN(X[[i]], ...)
 --- call from argument --- 
if (class(re) == "try-error") return(NaN) else return(re)
 --- R stacktrace ---
where 1: FUN(X[[i]], ...)
where 2: lapply(X = X, FUN = FUN, ...)
where 3: sapply(periods, function(p) {
    re <- try(cor(x[p], y[p], use = "everything"), silent = T)
    if (class(re) == "try-error") 
        return(NaN)
    else return(re)
})
where 4: corr_by_period(GFT_xts$CDC.data, GFT_xts[, name], periods)
where 5: FUN(X[[i]], ...)
where 6: lapply(X = X, FUN = FUN, ...)
where 7: sapply(model_names, function(name) corr_by_period(GFT_xts$CDC.data, 
    GFT_xts[, name], periods))
where 8: summary_argo(GFT_xts = GFT_xts, model_names = colnames(GFT_xts)[-1], 
    legend_names = paste0(colnames(GFT_xts)[-1], "legend"), periods = c(paste0(zoo::index(GFT_xts)[1], 
        "/", zoo::index(GFT_xts)[49]), paste0(zoo::index(GFT_xts)[50], 
        "/", zoo::index(GFT_xts)[100])), whole_period = "2009-03/")

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (p) 
{
    re <- try(cor(x[p], y[p], use = "everything"), silent = T)
    if (class(re) == "try-error") 
        return(NaN)
    else return(re)
}
<bytecode: 0xa9314f0>
<environment: 0xa98bf60>
 --- function search by body ---
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(re) == "try-error") return(NaN) else return(re) : 
  the condition has length > 1
Calls: summary_argo ... lapply -> FUN -> corr_by_period -> sapply -> lapply -> FUN
Execution halted