Fixed error reported in issue #13 when using the function MergeRefToExp with one of the input data to merge with the dimension time equal to 1. The error was solved in SelectPeriodOnData function adding the conditional if statement in the following lines:
res <- Apply(list(data, res), target_dims = time_dim,
fun = function(x, y) {
res <- x[y]
if (is.null(dim(res))) {
dim(res) <- 1
names(dim(res)) <- time_dim
}
return(res)
}, output_dims = time_dim, ncores = ncores)$output1
}