Running examples in ‘ParentOffspring-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: ParentOffspring
> ### Title: Conduct the Parent-Offspring Test Using Monomorphic SNP Markers
> ### Aliases: ParentOffspring
> ### Keywords: parent offspring test monomorphic SNP markers
> 
> ### ** Examples
> 
> 
> # a very simple example
> 
> genotypeMatrix = matrix( 
+     c("GG",  "GG",   "GG",  "CG",  "CG",  "GG",
+       "AA",  "AA",   "AA",  "--",  "AA",  "AA", 
+       "AA",  "AA",   "GG",  "AA",  "AA",  "AA", 
+       "GG",  "AA",   "GG",  "GG",	 "GG",  "GG"),  
+     byrow=TRUE, 
+     nrow=4, 
+     ncol=6) 
> # Compute and plot the parent-offspring similarity for each offspring
> ParentOffspring(genotypeMatrix)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
ParentOffspring
 --- call from context --- 
ParentOffspring(genotypeMatrix)
 --- call from argument --- 
if (class(genoMat) == "data.frame") genoMat = as.matrix(genoMat)
 --- R stacktrace ---
where 1: ParentOffspring(genotypeMatrix)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (genoMat, plot = TRUE) 
{
    if (class(genoMat) == "data.frame") 
        genoMat = as.matrix(genoMat)
    dimension = dim(genoMat)
    if (dimension[1] < 1) 
        stop("the input genoMat is empty")
    if (dimension[2] < 3) 
        stop("the input genoMat should have at least 3 columns")
    aa = unlist(lapply(unlist(genoMat), is.character))
    if (min(aa) == 0) 
        stop("the input genoMat has noncharacter values")
    if (min(nchar(unlist(genoMat)) == 2) == 0) 
        stop("the input genoMat has values which are not 2-letter strings")
    geno <- genoMat
    geno <- geno[(geno[, 1]) == (geno[, 2]), ]
    geno <- geno[(substr(geno[, 1], 1, 1)) == (substr(geno[, 
        1], 2, 2)), ]
    geno <- geno[(geno[, 1]) != "--", ]
    dimension <- dim(geno)
    markersN <- dimension[1]
    offspringN <- dimension[2] - 2
    if (markersN < 1) 
        stop("No monomorphic markers can be used")
    parent <- geno[, 1]
    offspring <- geno[, -(1:2)]
    markersValidN <- rep(0, offspringN)
    similarityMat <- matrix(0, markersN, offspringN)
    for (i in 1:offspringN) {
        similarityMat[, i] <- (substr(parent, 1, 1) == substr(offspring[, 
            i], 1, 1)) + (substr(parent, 1, 1) == substr(offspring[, 
            i], 2, 2))
        for (j in 1:markersN) {
            if ((substr(offspring[j, i], 1, 1) == "-") || (substr(offspring[j, 
                i], 2, 2) == "-")) {
                similarityMat[j, i] <- NA
            }
        }
        markersValidN[i] <- markersN - sum(is.na(similarityMat[, 
            i]))
    }
    similarityMat <- similarityMat/2
    similarity <- round(colMeans(similarityMat, na.rm = T), 2)
    if (plot == TRUE) {
        plot(1:offspringN, sort(similarity, decreasing = T), 
            pch = "*", cex = 2, col = "red", ylim = c(0.5, 1), 
            xlab = "offspring sorted by similarity", ylab = "similarity", 
            axes = FALSE)
        axis(side = 1, at = 1:offspringN)
        axis(side = 2, at = c(round((5:10)/10, 1), 0.95, 0.99))
        abline(h = c(0.9, 0.95, 0.99), lty = 2, col = "blue", 
            lwd = 2)
        title("Similarity to the Parents")
        box()
    }
    return(similarity)
}
<bytecode: 0x55bfc563d3c8>
<environment: namespace:ParentOffspring>
 --- function search by body ---
Function ParentOffspring in namespace ParentOffspring has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(genoMat) == "data.frame") genoMat = as.matrix(genoMat) : 
  the condition has length > 1
Calls: ParentOffspring
Execution halted