Package: BMA Check: examples New result: ERROR Running examples in ‘BMA-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: iBMA > ### Title: Iterated Bayesian Model Averaging variable selection for > ### generalized linear models, linear models or survival models. > ### Aliases: iBMA iBMA.glm iBMA.bicreg iBMA.surv iBMA.glm.data.frame > ### iBMA.glm.matrix iBMA.glm.iBMA.intermediate.glm iBMA.bicreg.data.frame > ### iBMA.bicreg.matrix iBMA.bicreg.iBMA.intermediate.bicreg > ### iBMA.surv.data.frame iBMA.surv.matrix > ### iBMA.surv.iBMA.intermediate.surv > ### Keywords: regression survival > > ### ** Examples > > > ## Not run: > ##D ############ iBMA.glm > ##D library("MASS") > ##D data(birthwt) > ##D y<- birthwt$lo > ##D x<- data.frame(birthwt[,-1]) > ##D x$race<- as.factor(x$race) > ##D x$ht<- (x$ht>=1)+0 > ##D x<- x[,-9] > ##D x$smoke <- as.factor(x$smoke) > ##D x$ptl<- as.factor(x$ptl) > ##D x$ht <- as.factor(x$ht) > ##D x$ui <- as.factor(x$ui) > ##D > ##D ### add 41 columns of noise > ##D noise<- matrix(rnorm(41*nrow(x)), ncol=41) > ##D colnames(noise)<- paste('noise', 1:41, sep='') > ##D x<- cbind(x, noise) > ##D > ##D iBMA.glm.out<- iBMA.glm( x, y, glm.family="binomial", > ##D factor.type=FALSE, verbose = TRUE, > ##D thresProbne0 = 5 ) > ##D summary(iBMA.glm.out) > ## End(Not run) > > ## Not run: > ##D ################## iBMA.surv > ##D library(survival) > ##D data(cancer) > ##D > ##D surv.t<- veteran$time > ##D cens<- veteran$status > ##D veteran$time<- NULL > ##D veteran$status<- NULL > ##D lvet<- nrow(veteran) > ##D invlogit<- function(x) exp(x)/(1+exp(x)) > ##D # generate random noise, 34 uniform variables > ##D # and 10 factors each with 4 levels > ##D X <- data.frame(matrix(runif(lvet*34), ncol=34), > ##D matrix(letters[1:6][(rbinom(10*lvet, 3, .5))+1], > ##D ncol = 10)) > ##D colnames(X) <- c(paste("u",1:34, sep=""),paste("C",1:10, sep="")) > ##D for(i in 35:44) X[,i] <- as.factor(X[,i]) > ##D veteran_plus_noise<- cbind(veteran, X) > ##D > ##D > ##D test.iBMA.surv <- iBMA.surv(x = veteran_plus_noise, > ##D surv.t = surv.t, cens = cens, > ##D thresProbne0 = 5, maxNvar = 30, > ##D factor.type = TRUE, verbose = TRUE, > ##D nIter = 100) > ##D > ##D test.iBMA.surv > ##D summary(test.iBMA.surv) > ## End(Not run) > > ## Not run: > ##D ############ iBMA.bicreg ... degenerate example > ##D library(MASS) > ##D data(UScrime) > ##D UScrime$M<- log(UScrime$M); UScrime$Ed<- log(UScrime$Ed); > ##D UScrime$Po1<- log(UScrime$Po1); UScrime$Po2<- log(UScrime$Po2); > ##D UScrime$LF<- log(UScrime$LF); UScrime$M.F<- log(UScrime$M.F) > ##D UScrime$Pop<- log(UScrime$Pop); UScrime$NW<- log(UScrime$NW); > ##D UScrime$U1<- log(UScrime$U1); UScrime$U2<- log(UScrime$U2); > ##D UScrime$GDP<- log(UScrime$GDP); UScrime$Ineq<- log(UScrime$Ineq) > ##D UScrime$Prob<- log(UScrime$Prob); UScrime$Time<- log(UScrime$Time) > ##D noise<- matrix(rnorm(35*nrow(UScrime)), ncol=35) > ##D colnames(noise)<- paste('noise', 1:35, sep='') > ##D UScrime_plus_noise<- cbind(UScrime, noise) > ##D > ##D y<- UScrime_plus_noise$y > ##D UScrime_plus_noise$y <- NULL > ##D > ##D # run 2 iterations and examine results > ##D iBMA.bicreg.crime <- iBMA.bicreg( x = UScrime_plus_noise, > ##D Y = y, thresProbne0 = 5, verbose = TRUE, maxNvar = 30, nIter = 2) > ##D summary(iBMA.bicreg.crime) > ##D orderplot(iBMA.bicreg.crime) > ## End(Not run) > > ## Not run: > ##D # run from current state until completion > ##D iBMA.bicreg.crime <- iBMA.bicreg( iBMA.bicreg.crime, nIter = 200) > ##D summary(iBMA.bicreg.crime) > ##D orderplot(iBMA.bicreg.crime) > ## End(Not run) > > set.seed(0) > x <- matrix( rnorm(50*30), 50, 30) > lp <- apply( x[,1:5], 1, sum) > iBMA.bicreg.ex <- iBMA.bicreg( x = x, Y = lp, thresProbne0 = 5, maxNvar = 20) > > explp <- exp(lp) > prob <- explp/(1+explp) > y=rbinom(n=length(prob),prob=prob,size=1) > iBMA.glm.ex <- iBMA.glm( x = x, Y = y, glm.family = "binomial", + factor.type = FALSE, thresProbne0 = 5, maxNvar = 20) ERROR(s) during compilation: source code errors or compiler configuration errors! make cmd is make -f '/home/hornik/tmp/R/etc/Makeconf' -f '/home/hornik/tmp/R/share/make/shlib.mk' -f '/home/hornik/.R/Makevars-gcc' SHLIB='file2b118a307991ad.so' CXX_DEFS=-DR_NO_REMAP OBJECTS='file2b118a307991ad.o' make would use gcc-14 -I"/home/hornik/tmp/R/include" -DNDEBUG -DR_NO_REMAP -I/usr/local/include -DUSE_TYPE_CHECKING_STRICT -D_FORTIFY_SOURCE=3 -fpic -g -O2 -Wall -Wstrict-prototypes -pedantic -mtune=native -c file2b118a307991ad.c -o file2b118a307991ad.o if test "zfile2b118a307991ad.o" != "z"; then \ echo gcc-14 -shared -L"/home/hornik/tmp/R/lib" -Wl,-O1 -o file2b118a307991ad.so file2b118a307991ad.o -L"/home/hornik/tmp/R/lib" -lR; \ gcc-14 -shared -L"/home/hornik/tmp/R/lib" -Wl,-O1 -o file2b118a307991ad.so file2b118a307991ad.o -L"/home/hornik/tmp/R/lib" -lR; \ fi Program source: 1: #include 2: #include 3: #include 4: 5: 6: /* This is taken from envir.c in the R 2.15.1 source 7: https://github.com/SurajGupta/r-source/blob/master/src/main/envir.c 8: */ 9: #define FRAME_LOCK_MASK (1<<14) 10: #define FRAME_IS_LOCKED(e) (ENVFLAGS(e) & FRAME_LOCK_MASK) 11: #define UNLOCK_FRAME(e) SET_ENVFLAGS(e, ENVFLAGS(e) & (~ FRAME_LOCK_MASK)) 12: 13: 14: SEXP file2b118a307991ad ( SEXP env ) { 15: 16: if (TYPEOF(env) == NILSXP) 17: error("use of NULL environment is defunct"); 18: if (TYPEOF(env) != ENVSXP) 19: error("not an environment"); 20: 21: UNLOCK_FRAME(env); 22: 23: // Return TRUE if unlocked; FALSE otherwise 24: SEXP result = PROTECT( Rf_allocVector(LGLSXP, 1) ); 25: LOGICAL(result)[0] = FRAME_IS_LOCKED(env) == 0; 26: UNPROTECT(1); 27: 28: return result; 29: 30: Rf_warning("your C program does not return anything!"); 31: return R_NilValue; 32: } Compilation ERROR, function(s)/method(s) not created! Error in compileCode(f, code, language, verbose) : using C compiler: ‘gcc-14 (Debian 14.2.0-8) 14.2.0’ file2b118a307991ad.c: In function ‘file2b118a307991ad’: file2b118a307991ad.c:17:1: error: implicit declaration of function ‘error’; did you mean ‘perror’? [-Wimplicit-function-declaration] 17 | error("use of NULL environment is defunct"); | ^~~~~ | perror make: *** [/home/hornik/tmp/R/etc/Makeconf:195: file2b118a307991ad.o] Error 1 Calls: iBMA.glm -> iBMA.glm.matrix -> cfunction -> compileCode Execution halted