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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: RGWAS.twostep
> ### Title: Perform normal GWAS (genome-wide association studies) first,
> ###   then perform SNP-set GWAS for relatively significant markers
> ### Aliases: RGWAS.twostep
> 
> ### ** Examples
> 
> ## Don't show: 
>   ### Import RAINBOWR
>   require(RAINBOWR)
>   
>   ### Load example datasets
>   data("Rice_Zhao_etal")
>   Rice_geno_score <- Rice_Zhao_etal$genoScore
>   Rice_geno_map <- Rice_Zhao_etal$genoMap
>   Rice_pheno <- Rice_Zhao_etal$pheno
>   
>   
>   ### Select one trait for example
>   trait.name <- "Flowering.time.at.Arkansas"
>   y <- as.matrix(Rice_pheno[1:30, trait.name, drop = FALSE])
>   # use first 30 accessions
>   
>   ### Remove SNPs whose MAF <= 0.05
>   x.0 <- t(Rice_geno_score)
>   MAF.cut.res <- MAF.cut(x.0 = x.0, map.0 = Rice_geno_map)
>   x <- MAF.cut.res$x
>   map <- MAF.cut.res$map
>   
>   
>   ### Estimate genetic relationship matrix
>   K.A <- rrBLUP::A.mat(x) ### rrBLUP package can be installed by install.packages("rrBLUP")
>   
>   
>   ### Modify data
>   modify.data.res <- modify.data(pheno.mat = y, geno.mat = x, map = map,
+                                  return.ZETA = TRUE, return.GWAS.format = TRUE)
Warning in modify.data(pheno.mat = y, geno.mat = x, map = map, return.ZETA = TRUE,  :
  The following lines have phenotypes but no genotypes:  L14, L31, L33
>   pheno.GWAS <- modify.data.res$pheno.GWAS
>   geno.GWAS <- modify.data.res$geno.GWAS
>   ZETA <- modify.data.res$ZETA
>   
>   
>   ### Perform two step SNP-set GWAS (single-snp GWAS -> SNP-set GWAS for significant markers)
>   twostep.SNP_set.res <- RGWAS.twostep(pheno = pheno.GWAS, geno = geno.GWAS, ZETA = ZETA,
+                                        kernel.percent = 0.2, n.PC = 4, test.method.2 = "LR",
+                                        kernel.method = "linear", gene.set = NULL,
+                                        test.effect.2 = "additive", window.size.half = 3,
+                                        window.slide = 2, plot.qq.1 = FALSE,
+                                        plot.Manhattan.1 = FALSE, plot.qq.2 = FALSE,
+                                        plot.Manhattan.2 = FALSE, verbose = FALSE,
+                                        count = FALSE, time = FALSE)

 *** caught segfault ***
address 0x50, cause 'memory not mapped'

Traceback:
 1: as.matrix(x)
 2: unname(as.matrix(x))
 3: (function (x, symmetric, only.values = FALSE, EISPACK = FALSE) {    x <- unname(as.matrix(x))    n <- nrow(x)    if (!n)         stop("0 x 0 matrix")    if (n != ncol(x))         stop("non-square matrix in 'eigen'")    n <- as.integer(n)    if (is.na(n))         stop("invalid nrow(x)")    complex.x <- is.complex(x)    if (!all(is.finite(x)))         stop("infinite or missing values in 'x'")    if (missing(symmetric))         symmetric <- isSymmetric.matrix(x)    if (symmetric) {        z <- if (!complex.x)             .Internal(La_rs(x, only.values))        else .Internal(La_rs_cmplx(x, only.values))        ord <- rev(seq_along(z$values))    }    else {        z <- if (!complex.x)             .Internal(La_rg(x, only.values))        else .Internal(La_rg_cmplx(x, only.values))        ord <- sort.list(Mod(z$values), decreasing = TRUE)    }    if (only.values)         list(values = z$values[ord], vectors = NULL)    else structure(class = "eigen", list(values = z$values[ord],         vectors = z$vectors[, ord, drop = FALSE]))})(NULL, FALSE)
 4: evalq((function (x, symmetric, only.values = FALSE, EISPACK = FALSE) {    x <- unname(as.matrix(x))    n <- nrow(x)    if (!n)         stop("0 x 0 matrix")    if (n != ncol(x))         stop("non-square matrix in 'eigen'")    n <- as.integer(n)    if (is.na(n))         stop("invalid nrow(x)")    complex.x <- is.complex(x)    if (!all(is.finite(x)))         stop("infinite or missing values in 'x'")    if (missing(symmetric))         symmetric <- isSymmetric.matrix(x)    if (symmetric) {        z <- if (!complex.x)             .Internal(La_rs(x, only.values))        else .Internal(La_rs_cmplx(x, only.values))        ord <- rev(seq_along(z$values))    }    else {        z <- if (!complex.x)             .Internal(La_rg(x, only.values))        else .Internal(La_rg_cmplx(x, only.values))        ord <- sort.list(Mod(z$values), decreasing = TRUE)    }    if (only.values)         list(values = z$values[ord], vectors = NULL)    else structure(class = "eigen", list(values = z$values[ord],         vectors = z$vectors[, ord, drop = FALSE]))})(NULL, FALSE), <environment>)
 5: evalq((function (x, symmetric, only.values = FALSE, EISPACK = FALSE) {    x <- unname(as.matrix(x))    n <- nrow(x)    if (!n)         stop("0 x 0 matrix")    if (n != ncol(x))         stop("non-square matrix in 'eigen'")    n <- as.integer(n)    if (is.na(n))         stop("invalid nrow(x)")    complex.x <- is.complex(x)    if (!all(is.finite(x)))         stop("infinite or missing values in 'x'")    if (missing(symmetric))         symmetric <- isSymmetric.matrix(x)    if (symmetric) {        z <- if (!complex.x)             .Internal(La_rs(x, only.values))        else .Internal(La_rs_cmplx(x, only.values))        ord <- rev(seq_along(z$values))    }    else {        z <- if (!complex.x)             .Internal(La_rg(x, only.values))        else .Internal(La_rg_cmplx(x, only.values))        ord <- sort.list(Mod(z$values), decreasing = TRUE)    }    if (only.values)         list(values = z$values[ord], vectors = NULL)    else structure(class = "eigen", list(values = z$values[ord],         vectors = z$vectors[, ord, drop = FALSE]))})(NULL, FALSE), <environment>)
 6: doTryCatch(return(expr), name, parentenv, handler)
 7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
 8: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
 9: doTryCatch(return(expr), name, parentenv, handler)
10: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
11: tryCatchList(expr, classes, parentenv, handlers)
12: tryCatch(evalq((function (x, symmetric, only.values = FALSE,     EISPACK = FALSE) {    x <- unname(as.matrix(x))    n <- nrow(x)    if (!n)         stop("0 x 0 matrix")    if (n != ncol(x))         stop("non-square matrix in 'eigen'")    n <- as.integer(n)    if (is.na(n))         stop("invalid nrow(x)")    complex.x <- is.complex(x)    if (!all(is.finite(x)))         stop("infinite or missing values in 'x'")    if (missing(symmetric))         symmetric <- isSymmetric.matrix(x)    if (symmetric) {        z <- if (!complex.x)             .Internal(La_rs(x, only.values))        else .Internal(La_rs_cmplx(x, only.values))        ord <- rev(seq_along(z$values))    }    else {        z <- if (!complex.x)             .Internal(La_rg(x, only.values))        else .Internal(La_rg_cmplx(x, only.values))        ord <- sort.list(Mod(z$values), decreasing = TRUE)    }    if (only.values)         list(values = z$values[ord], vectors = NULL)    else structure(class = "eigen", list(values = z$values[ord],         vectors = z$vectors[, ord, drop = FALSE]))})(NULL, FALSE), <environment>), error = function (x) x, interrupt = function (x) x)
13: P_calc(lambda, Ws, Gammas, U2, as.matrix(delta2), lw, TRUE, gammas.diag)
14: objective(.par, ...)
15: nlminb(start = parInit, objective = minimumfunctionouter, gradient = NULL,     hessian = NULL, lower = parLower, upper = parUpper, control = list(trace = traceInside))
16: EM3.linker.cpp(y0 = y, X0 = X.now, ZETA = ZETA.now, optimizer = optimizer,     Zs0 = Zs0.A, Ws0 = Ws0.A, Gammas0 = Gammas0.A, gammas.diag = TRUE,     X.fix = TRUE, tol = NULL, eigen.SGS = eigen.SGS, eigen.G = eigen.G,     REML = TRUE, pred = FALSE)
17: doTryCatch(return(expr), name, parentenv, handler)
18: tryCatchOne(expr, names, parentenv, handlers[[1L]])
19: tryCatchList(expr, classes, parentenv, handlers)
20: tryCatch(expr, error = function(e) {    call <- conditionCall(e)    if (!is.null(call)) {        if (identical(call[[1L]], quote(doTryCatch)))             call <- sys.call(-4L)        dcall <- deparse(call)[1L]        prefix <- paste("Error in", dcall, ": ")        LONG <- 75L        sm <- strsplit(conditionMessage(e), "\n")[[1L]]        w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")        if (is.na(w))             w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],                 type = "b")        if (w > LONG)             prefix <- paste0(prefix, "\n  ")    }    else prefix <- "Error : "    msg <- paste0(prefix, conditionMessage(e), "\n")    .Internal(seterrmessage(msg[1L]))    if (!silent && isTRUE(getOption("show.error.messages"))) {        cat(msg, file = outFile)        .Internal(printDeferredWarnings())    }    invisible(structure(msg, class = "try-error", condition = e))})
21: try(EM3.linker.cpp(y0 = y, X0 = X.now, ZETA = ZETA.now, optimizer = optimizer,     Zs0 = Zs0.A, Ws0 = Ws0.A, Gammas0 = Gammas0.A, gammas.diag = TRUE,     X.fix = TRUE, tol = NULL, eigen.SGS = eigen.SGS, eigen.G = eigen.G,     REML = TRUE, pred = FALSE), silent = TRUE)
22: score.calc.LR(M.now = M.now, y = y, X.now = X.now, ZETA.now = ZETA.now,     LL0 = LL0, eigen.SGS = eigen.SGS, eigen.G = eigen.G, map = map,     optimizer = optimizer, kernel.method = kernel.method, kernel.h = kernel.h,     haplotype = haplotype, num.hap = num.hap, test.effect = test.effect,     window.size.half = window.size.half, window.slide = window.slide,     chi0.mixture = chi0.mixture, weighting.center = weighting.center,     weighting.other = weighting.other, gene.set = gene.set, min.MAF = min.MAF,     count = count)
23: RGWAS.multisnp(pheno = pheno.now, geno = geno.check, ZETA = ZETA,     covariate = covariate, covariate.factor = covariate.factor,     structure.matrix = structure.matrix, n.PC = n.PC, min.MAF = min.MAF,     test.method = test.method.2, n.core = n.core, kernel.method = kernel.method,     kernel.h = kernel.h, haplotype = haplotype, num.hap = num.hap,     test.effect = test.effect.2, window.size.half = window.size.half,     window.slide = window.slide, chi0.mixture = chi0.mixture,     gene.set = gene.set.now, weighting.center = weighting.center,     weighting.other = weighting.other, sig.level = sig.level,     method.thres = method.thres, plot.qq = FALSE, plot.Manhattan = FALSE,     plot.method = plot.method, plot.col1 = plot.col1, plot.col2 = plot.col2,     plot.type = plot.type, plot.pch = plot.pch, saveName = saveName,     main.qq = main.qq.2, main.man = main.man.2, plot.add.last = FALSE,     return.EMM.res = TRUE, optimizer = optimizer, thres = FALSE,     verbose = verbose, count = count, time = time)
24: RGWAS.twostep(pheno = pheno.GWAS, geno = geno.GWAS, ZETA = ZETA,     kernel.percent = 0.2, n.PC = 4, test.method.2 = "LR", kernel.method = "linear",     gene.set = NULL, test.effect.2 = "additive", window.size.half = 3,     window.slide = 2, plot.qq.1 = FALSE, plot.Manhattan.1 = FALSE,     plot.qq.2 = FALSE, plot.Manhattan.2 = FALSE, verbose = FALSE,     count = FALSE, time = FALSE)
An irrecoverable exception occurred. R is aborting now ...
Segmentation fault