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

> ### Name: coxmeg_plink
> ### Title: Perform GWAS using a Cox mixed-effects model with plink files as
> ###   input
> ### Aliases: coxmeg_plink
> ### Keywords: Cox mixed-effects model
> 
> ### ** Examples
> 
> library(Matrix)
> library(MASS)
> library(coxmeg)
> 
> ## build a block-diagonal relatedness matrix
> n_f <- 600
> mat_list <- list()
> size <- rep(5,n_f)
> offd <- 0.5
> for(i in 1:n_f)
+ {
+   mat_list[[i]] <- matrix(offd,size[i],size[i])
+   diag(mat_list[[i]]) <- 1
+ }
> sigma <- as.matrix(bdiag(mat_list))
> 
> ## Estimate variance component under a null model
> pheno = system.file("extdata", "ex_pheno.txt", package = "coxmeg")
> cov = system.file("extdata", "ex_cov.txt", package = "coxmeg")
> bed = system.file("extdata", "example_null.bed", package = "coxmeg")
> bed = substr(bed,1,nchar(bed)-4)
> re = coxmeg_plink(pheno,sigma,type='bd',bed=bed,tmp_dir=tempdir(),cov_file=cov,
+ detap='diagonal',order=1)
Remove 0 subjects censored before the first failure.
There is/are 1 covariates. The sample size included is 3000.
The relatedness matrix is treated as sparse.
The relatedness matrix is inverted.
The method for computing the determinant is 'diagonal'.
Solver: Cholesky decomposition (RcppEigen=TRUE).
The variance component is estimated. Start analyzing SNPs...
Start snpgdsBED2GDS ...
	BED file: "/Volumes/SSD-Data/Builds/R-dev-web/QA/Simon/packages/el-capitan-x86_64/results/3.5/coxmeg.Rcheck/coxmeg/extdata/example_null.bed" in the SNP-major mode (Sample X SNP)
	FAM file: "/Volumes/SSD-Data/Builds/R-dev-web/QA/Simon/packages/el-capitan-x86_64/results/3.5/coxmeg.Rcheck/coxmeg/extdata/example_null.fam", DONE.
	BIM file: "/Volumes/SSD-Data/Builds/R-dev-web/QA/Simon/packages/el-capitan-x86_64/results/3.5/coxmeg.Rcheck/coxmeg/extdata/example_null.bim", DONE.
Tue Jan 14 05:47:00 2020 	store sample id, snp id, position, and chromosome.
	start writing: 3000 samples, 20 SNPs ...
 	Tue Jan 14 05:47:00 2020	0%
 	Tue Jan 14 05:47:00 2020	100%
Tue Jan 14 05:47:00 2020 	Done.
Optimize the access efficiency ...
Clean up the fragments of GDS file:
    open the file '/tmp/RtmpQp57yL/tmp_26550866.gds' (18.7K)
    # of fragments: 38
    save to '/tmp/RtmpQp57yL/tmp_26550866.gds.tmp'
    rename '/tmp/RtmpQp57yL/tmp_26550866.gds.tmp' (18.4K, reduced: 240B)
    # of fragments: 18
Excluding 0 SNP on non-autosomes
Excluding 0 SNP (monomorphic: TRUE, MAF: 0.05, missing rate: 0)
The order is set to be 1.
Error in af_inc[, "afreq"] : incorrect number of dimensions
Calls: coxmeg_plink -> cbind
Execution halted