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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: GRAB.POLMM
> ### Title: POLMM method in GRAB package
> ### Aliases: GRAB.POLMM
> 
> ### ** Examples
> 
> ### First, Read Data and Convert Phenotype to a Factor
> library(dplyr)

Attaching package: ‘dplyr’

The following objects are masked from ‘package:stats’:

    filter, lag

The following objects are masked from ‘package:base’:

    intersect, setdiff, setequal, union

> PhenoFile <- system.file("extdata", "simuPHENO.txt", package = "GRAB")
> PhenoData <- data.table::fread(PhenoFile, header = TRUE)
> PhenoData <- PhenoData %>% mutate(OrdinalPheno = factor(OrdinalPheno,
+   levels = c(0, 1, 2)
+ ))
> 
> ### Step 1: Fit a null model
> # If a sparse GRM is used in model fitting, SparseGRMFile is required.
> # If SparseGRMFile isn't provided, GRAB.NullModel() will calculate dense GRM from GenoFile.
> 
> SparseGRMFile <- system.file("SparseGRM", "SparseGRM.txt", package = "GRAB")
> GenoFile <- system.file("extdata", "simuPLINK.bed", package = "GRAB")
> obj.POLMM <- GRAB.NullModel(
+   formula = OrdinalPheno ~ AGE + GENDER,
+   data = PhenoData,
+   subjData = PhenoData$IID,
+   method = "POLMM",
+   traitType = "ordinal",
+   GenoFile = GenoFile,
+   SparseGRMFile = SparseGRMFile,
+   control = list(
+     showInfo = FALSE,
+     LOCO = FALSE,
+     tolTau = 0.2,
+     tolBeta = 0.1
+   )
+ )
Number of subjects in 'formula':	1000
Reading bim file:	/home/hornik/tmp/R.check/r-patched-gcc/Work/build/Packages/GRAB/extdata/simuPLINK.bim
Reading fam file:	/home/hornik/tmp/R.check/r-patched-gcc/Work/build/Packages/GRAB/extdata/simuPLINK.fam
setting PLINK object in CPP....
Reading bim file....
Reading fam file:	/home/hornik/tmp/R.check/r-patched-gcc/Work/build/Packages/GRAB/extdata/simuPLINK.fam
m_N:	1000
Setting position of samples in PLINK files....
posSampleInPlink:	501 510 600
SampleInModel:	Subj-1 Subj-10 Subj-100
SampleInPlink:	f1_1 f1_2 f1_3
Number of samples:	1000
Based on the 'GenoFile' and 'GenoFileIndex',PLINKformat is used for genotype data.
Sparse GRM is used when fitting a null model.
The below are the list of control parameters used in null model fitting.
2-1301000.10.20.21001e-061001e-100.10.1200.0025auto10.010.1FALSEFALSEFALSE
gIndex:	1016
gIndex:	678
gIndex:	128
gIndex:	929
gIndex:	470
gIndex:	298
gIndex:	269
gIndex:	596
gIndex:	329
gIndex:	36
gIndex:	728
gIndex:	877
gIndex:	484
gIndex:	873
gIndex:	381
gIndex:	974
gIndex:	800
gIndex:	851
gIndex:	930
gIndex:	325
gIndex:	1091
gIndex:	553
gIndex:	110
gIndex:	531
gIndex:	555
gIndex:	888
gIndex:	342
gIndex:	581
gIndex:	39
gIndex:	536
gIndex:	374
gIndex:	247
gIndex:	377
gIndex:	38
gIndex:	434
gIndex:	809
gIndex:	525
gIndex:	641
gIndex:	21
gIndex:	192
gIndex:	498
gIndex:	982
gIndex:	842
gIndex:	464
gIndex:	995
gIndex:	83
gIndex:	1052
gIndex:	251
gIndex:	732
gIndex:	619
gIndex:	556
gIndex:	286
gIndex:	613
gIndex:	328
gIndex:	486
gIndex:	854
gIndex:	850
gIndex:	857
gIndex:	618
gIndex:	575
gIndex:	989
gIndex:	1022
gIndex:	315
gIndex:	1051
gIndex:	649
gIndex:	1097
gIndex:	810
gIndex:	954
gIndex:	281
gIndex:	284
gIndex:	500
gIndex:	510
gIndex:	535
gIndex:	692
gIndex:	987
gIndex:	736
gIndex:	338
gIndex:	345
gIndex:	674
gIndex:	42
gIndex:	0
gIndex:	28
gIndex:	589
gIndex:	917
gIndex:	837
gIndex:	795
gIndex:	627
gIndex:	232
gIndex:	292
gIndex:	572
gIndex:	941
gIndex:	368
gIndex:	450
gIndex:	85
gIndex:	482
gIndex:	326
gIndex:	621
gIndex:	354
gIndex:	818
gIndex:	811
gIndex:	48
gIndex:	360
gIndex:	1037
gIndex:	241
gIndex:	439
gIndex:	757
gIndex:	816
gIndex:	817
gIndex:	246
gIndex:	750
gIndex:	218
gIndex:	134
It took 0.007332 seconds (0.003330 CPU seconds) to calculate 30 genKinbVec().
Start iteration .....
d2eps:	  -1.3071e+02

d1eps:	   2.7770

deps:	   0.0212

iter:	0
m_eps:	        0
   0.9821

eps0:	        0
   0.9609

m_tolEps:	1e-10
d2eps:	  -1.2536e+02

d1eps:	   0.0574

deps:	   0.0005

iter:	1
m_eps:	        0
   0.9826

eps0:	        0
   0.9821

m_tolEps:	1e-10
d2eps:	  -1.2525e+02

d1eps:	   2.5614e-05

deps:	   2.0451e-07

iter:	2
m_eps:	        0
   0.9826

eps0:	        0
   0.9826

m_tolEps:	1e-10
d2eps:	  -1.2525e+02

d1eps:	   5.0837e-12

deps:	   4.0590e-14

iter:	3
m_eps:	        0
   0.9826

eps0:	        0
   0.9826

m_tolEps:	1e-10
UpdateEps iter: 3
eps: 
        0
   0.9826

beta: 
  -37.5557
    0.5975
    0.3791

diffBeta:	0.00275036

Start updating tau...
iter: 0
beta: 
  -37.5557
    0.5975
    0.3791

tau: 0.0293943

d2eps:	  -1.2360e+02

d1eps:	  -2.2300

deps:	  -0.0180

iter:	0
m_eps:	        0
   0.9646

eps0:	        0
   0.9826

m_tolEps:	1e-10
d2eps:	  -1.2811e+02

d1eps:	   0.0403

deps:	   0.0003

iter:	1
m_eps:	        0
   0.9649

eps0:	        0
   0.9646

m_tolEps:	1e-10
d2eps:	  -1.2803e+02

d1eps:	   1.2656e-05

deps:	   9.8853e-08

iter:	2
m_eps:	        0
   0.9649

eps0:	        0
   0.9649

m_tolEps:	1e-10
d2eps:	  -1.2803e+02

d1eps:	   1.2440e-12

deps:	   9.7169e-15

iter:	3
m_eps:	        0
   0.9649

eps0:	        0
   0.9649

m_tolEps:	1e-10
UpdateEps iter: 3
eps: 
        0
   0.9649

beta: 
  -37.5479
    0.5974
    0.3811

diffBeta:	0.00231347

Start updating tau...
iter: 1
beta: 
  -37.5479
    0.5974
    0.3811

tau: 0.0136161

It took 0.085028 seconds (0.064952 CPU seconds) to fit the null POLMM..
Start estimating variance ratio....
nSNPs for CV: 20
CV: 5.84339e-06
Complete the null model fitting in package GRAB:	Complete Time: 2025-08-13 05:32:49.717459
> 
> objPOLMMFile <- system.file("results", "objPOLMMFile.RData", package = "GRAB")
> save(obj.POLMM, file = objPOLMMFile)
Warning in gzfile(file, "wb") :
  cannot open compressed file '/home/hornik/tmp/R.check/r-patched-gcc/Work/build/Packages/GRAB/results/objPOLMMFile.RData', probable reason 'Read-only file system'
Error in gzfile(file, "wb") : cannot open the connection
Calls: save -> gzfile
Execution halted