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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: apply.LTR
> ### Title: Apply a fitted LTR model to a new dataset
> ### Aliases: apply.LTR
> ### Keywords: models
> 
> ### ** Examples
> 
> x <- matrix(nrow = 100, ncol = 10, data = rnorm(1000));
> y <- matrix(nrow = 100, ncol = 10, data = rnorm(1000));
> model.fit <- fit.LTR(x, y);
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
LTR
 --- call from context --- 
fit.LTR(x, y)
 --- call from argument --- 
if (class(dataset1) != "matrix") {
    stop("dataset1 is not a matrix")
}
 --- R stacktrace ---
where 1: fit.LTR(x, y)

 --- value of length: 2 type: logical ---
[1] FALSE  TRUE
 --- function from context --- 
function (dataset1, dataset2) 
{
    dataset1 <- as.matrix(dataset1)
    dataset2 <- as.matrix(dataset2)
    if (class(dataset1) != "matrix") {
        stop("dataset1 is not a matrix")
    }
    if (class(dataset2) != "matrix") {
        stop("dataset2 is not a matrix")
    }
    if (ncol(dataset1) != ncol(dataset2)) {
        stop("dataset1 and dataset2 have different numbers of columns")
    }
    if (nrow(dataset1) != nrow(dataset2)) {
        stop("dataset1 and dataset2 have different numbers of rows")
    }
    if (!all(rownames(dataset1) == rownames(dataset2))) {
        warning("non-matching rownames for dataset1 and dataset2")
    }
    to.return <- list(rownames = rownames(dataset1), intercepts = vector(mode = "numeric", 
        length = nrow(dataset1)), slopes = vector(mode = "numeric", 
        length = nrow(dataset1)), r.squared = vector(mode = "numeric", 
        length = nrow(dataset1)), residuals = matrix(nrow = nrow(dataset1), 
        ncol = ncol(dataset1)))
    for (i in 1:nrow(dataset1)) {
        fit <- lm(formula = dataset2 ~ dataset1, data = data.frame(dataset2 = dataset2[i, 
            ], dataset1 = dataset1[i, ]))
        to.return$intercepts[i] <- as.numeric(fit$coefficients[1])
        to.return$slopes[i] <- as.numeric(fit$coefficients[2])
        to.return$r.squared[i] <- summary(fit)$r.squared
        to.return$residuals[i, ] <- as.numeric(fit$residuals)
    }
    return(to.return)
}
<bytecode: 0x1ebd670>
<environment: namespace:LTR>
 --- function search by body ---
Function fit.LTR in namespace LTR has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(dataset1) != "matrix") { : 
  the condition has length > 1
Calls: fit.LTR
Execution halted