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

> ### Name: flex_co
> ### Title: Obtain flexible cutoffs for one or two models
> ### Aliases: flex_co
> 
> ### ** Examples
> 
> #Note: Demonstration only! Please use higher numbers of replications for your applications (>= 500).
> #A single model to obtain fit indices for
> mod <- "
+ F1 =~ Q5 + Q7 + Q8
+ F2 =~ Q2 + Q4
+ F3 =~ Q10 + Q11 + Q12 + Q13 + Q18 + Q19 + Q20 + Q21 + Q22
+ F4 =~ Q1 + Q17
+ F5 =~ Q6 + Q14 + Q15 + Q16
+ "
> fits.single <- gen_fit(mod1 = mod, x = bb1992, rep = 10, standardized = FALSE)
Warning in pop_mod(mod = mod1, x = x, type = type, standardized = standardized) :
  All loadings are < 1. Consider revision of standardized.

 *** caught segfault ***
address 0x110, cause 'invalid permissions'

 *** caught segfault ***
address 0x110, cause 'invalid permissions'

Traceback:
 1: lav_samplestats_Gamma(Y = Y, x.idx = x.idx[[g]], cluster.idx = cluster.idx,     fixed.x = fixed.x, conditional.x = conditional.x, meanstructure = meanstructure,     slopestructure = conditional.x, gamma.n.minus.one = lavoptions$gamma.n.minus.one,     unbiased = lavoptions$gamma.unbiased, Mplus.WLS = FALSE)
 2: lav_samplestats_from_data(lavdata = lavdata, lavoptions = lavoptions,     WLS.V = WLS.V, NACOV = NACOV)
 3: lav_lavaan_step05_samplestats(slotSampleStats = slotSampleStats,     lavdata = lavdata, lavoptions = lavoptions, WLS.V = WLS.V,     NACOV = NACOV, sample.cov = sample.cov, sample.mean = sample.mean,     sample.th = sample.th, sample.nobs = sample.nobs, ov.names = ov.names,     ov.names.x = ov.names.x, lavpartable = lavpartable)
 4: lavaan::lavaan(free1, y, estimator = "MLM", auto.fix.first = FALSE,     std.lv = TRUE, warn = FALSE, model.type = "cfa")
 5: eval(sc, parent.frame())
 6: eval(sc, parent.frame())
 7: lavaan::cfa(free1, y, estimator = "MLM", auto.fix.first = FALSE,     std.lv = TRUE, warn = FALSE)
 8: doTryCatch(return(expr), name, parentenv, handler)
 9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
10: tryCatchList(expr, classes, parentenv, handlers)
11: 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, nlines = 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())    }
Traceback:
 1: lav_samplestats_Gamma(Y = Y, x.idx = x.idx[[g]], cluster.idx = cluster.idx,     fixed.x = fixed.x, conditional.x = conditional.x, meanstructure = meanstructure,     slopestructure = conditional.x, gamma.n.minus.one = lavoptions$gamma.n.minus.one,     unbiased = lavoptions$gamma.unbiased, Mplus.WLS = FALSE)    invisible(structure(msg, class = "try-error", condition = e))})
12: try(lavaan::cfa(free1, y, estimator = "MLM", auto.fix.first = FALSE, 
 2: lav_samplestats_from_data(lavdata = lavdata, lavoptions = lavoptions,     WLS.V = WLS.V, NACOV = NACOV)
 3: lav_lavaan_step05_samplestats(slotSampleStats = slotSampleStats,     std.lv = TRUE, warn = FALSE), silent = TRUE)
13: generator(x = x, n = n, seed = seeds[r], mode = mode, pop.mod1 = pop.mod,     free1 = free, s = s, k = k, nf = nf)
14: FUN(X[[i]], ...)
    lavdata = lavdata, lavoptions = lavoptions, WLS.V = WLS.V,     NACOV = NACOV, sample.cov = sample.cov, sample.mean = sample.mean,     sample.th = sample.th, sample.nobs = sample.nobs, ov.names = ov.names,     ov.names.x = ov.names.x, lavpartable = lavpartable)
15: lapply(X = S, FUN = FUN, ...)
16: doTryCatch(return(expr), name, parentenv, handler) 4: lavaan::lavaan(free1, y, estimator = "MLM", auto.fix.first = FALSE,     std.lv = TRUE, warn = FALSE, model.type = "cfa")
 5: 
17: tryCatchOne(expr, names, parentenv, handlers[[1L]])
18: tryCatchList(expr, classes, parentenv, handlers)
19: 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, nlines = 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], eval(sc, parent.frame())
 6: eval(sc, parent.frame())
 7: lavaan::cfa(free1, y, estimator = "MLM", auto.fix.first = FALSE,     std.lv = TRUE, warn = FALSE)                type = "b")        if (w > LONG)             prefix <- paste0(prefix, "\n  ")    }    else prefix <- "Error : "    msg <- paste0(prefix, conditionMessage(e), "\n")    .Internal(seterrmessage(msg[1L]))
 8: doTryCatch(return(expr), name, parentenv, handler)
 9:     if (!silent && isTRUE(getOption("show.error.messages"))) {        cat(msg, file = outFile)        .Internal(printDeferredWarnings())    }    invisible(structure(msg, class = "try-error", condition = e))tryCatchOne(expr, names, parentenv, handlers[[1L]])
10: tryCatchList(expr, classes, parentenv, handlers)
11: tryCatch(expr, error = function(e) {    call <- conditionCall(e)    if (!is.null(call)) {        if (identical(call[[1L]], quote(doTryCatch)))             call <- sys.call(-4L)})
20: try(lapply(X = S, FUN = FUN, ...), silent = TRUE)
21: sendMaster(try(lapply(X = S, FUN = FUN, ...), silent = TRUE))        dcall <- deparse(call, nlines = 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  ")
22: FUN(X[[i]], ...)
23: lapply(seq_len(cores), inner.do)
24: parallel::mclapply(1:rep, function(r) {    generator(x = x, n = n, seed = seeds[r], mode = mode, pop.mod1 = pop.mod,         free1 = free, s = s, k = k, nf = nf)    }    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))})}, mc.cores = cores)

25: gen_fit(mod1 = mod, x = bb1992, rep = 10, standardized = FALSE)
An irrecoverable exception occurred. R is aborting now ...
12: try(lavaan::cfa(free1, y, estimator = "MLM", auto.fix.first = FALSE,     std.lv = TRUE, warn = FALSE), silent = TRUE)
13: generator(x = x, n = n, seed = seeds[r], mode = mode, pop.mod1 = pop.mod,     free1 = free, s = s, k = k, nf = nf)
14: FUN(X[[i]], ...)
15: lapply(X = S, FUN = FUN, ...)
16: doTryCatch(return(expr), name, parentenv, handler)
17: tryCatchOne(expr, names, parentenv, handlers[[1L]])
18: tryCatchList(expr, classes, parentenv, handlers)
19: 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, nlines = 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))})
20: try(lapply(X = S, FUN = FUN, ...), silent = TRUE)
21: sendMaster(try(lapply(X = S, FUN = FUN, ...), silent = TRUE))
22: FUN(X[[i]], ...)
23: lapply(seq_len(cores), inner.do)
24: parallel::mclapply(1:rep, function(r) {    generator(x = x, n = n, seed = seeds[r], mode = mode, pop.mod1 = pop.mod,         free1 = free, s = s, k = k, nf = nf)}, mc.cores = cores)
25: gen_fit(mod1 = mod, x = bb1992, rep = 10, standardized = FALSE)
An irrecoverable exception occurred. R is aborting now ...
Warning in parallel::mclapply(1:rep, function(r) { :
  scheduled cores 1, 2 did not deliver results, all values of the jobs will be affected
> flex_co(fits = fits.single, index = c("CFI", "SRMR"))
Warning in flex_co(fits = fits.single, index = c("CFI", "SRMR")) :
  The number of replications is lower than the recommended minimum of 500. Consider with care.
Error in fits.nna[[1]] : subscript out of bounds
Calls: flex_co -> %in%
Execution halted