From 911ff5d776d03baac5314d69dc37391cdf593254 Mon Sep 17 00:00:00 2001 From: jenniferdguay <103517728+jenniferdguay@users.noreply.github.com> Date: Fri, 24 May 2024 13:19:04 +0200 Subject: [PATCH 1/3] Fix for mplus 8.11 --- R/parseOutput.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/parseOutput.R b/R/parseOutput.R index ee3dfa0..0b77e9e 100644 --- a/R/parseOutput.R +++ b/R/parseOutput.R @@ -1476,9 +1476,9 @@ extractCovarianceCoverage <- function(outfiletext, filename) { covcoverageList <- list() - covcoverageSubsections <- getMultilineSection("PROPORTION OF DATA PRESENT( FOR [\\w\\d\\s\\.,_]+)*", + covcoverageSubsections <- getMultilineSection("PROPORTION OF DATA PRESENT FOR \\w+(?:\\s+\\(\\d+\\))*\\s*$", covcoverageSection, filename, allowMultiple=TRUE) - + matchlines <- attr(covcoverageSubsections, "matchlines") if (length(covcoverageSubsections) == 0 || all(is.na(covcoverageSubsections))) { #See UG ex9.7.out From 2e2a2ee00422f4444d80613c5d84e8aab96d5de9 Mon Sep 17 00:00:00 2001 From: jenniferdguay <103517728+jenniferdguay@users.noreply.github.com> Date: Fri, 24 May 2024 13:52:08 +0200 Subject: [PATCH 2/3] Fix reading of groups in number of observations in summary of analysis --- R/readModels.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/readModels.R b/R/readModels.R index fbd02a4..dc6adcf 100644 --- a/R/readModels.R +++ b/R/readModels.R @@ -177,8 +177,8 @@ readModels <- function(target=getwd(), recursive=FALSE, filefilter, what="all", obs <- gsub("Group", "", obs) obs <- unlist(strsplit(trimws(obs), "\\s+")) if (isTRUE(length(obs) %% 2 == 0)) { - Observations <- as.numeric(obs[seq(2, to = length(obs), by = 2)]) - names(Observations) <- obs[seq(1, to = length(obs), by = 2)] + Observations <- as.numeric(obs[seq(3, to = length(obs), by = 3)]) + names(Observations) <- obs[seq(1, to = length(obs), by = 3)] attr(allFiles[[listID]]$summaries, "Observations") <- Observations } } From 980a451804636145db6f7235d381f462edbdc047 Mon Sep 17 00:00:00 2001 From: jenniferdguay <103517728+jenniferdguay@users.noreply.github.com> Date: Sat, 25 May 2024 15:21:23 +0200 Subject: [PATCH 3/3] revert to original readModel.R because group labels are added to the model syntax --- R/readModels.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/readModels.R b/R/readModels.R index dc6adcf..fbd02a4 100644 --- a/R/readModels.R +++ b/R/readModels.R @@ -177,8 +177,8 @@ readModels <- function(target=getwd(), recursive=FALSE, filefilter, what="all", obs <- gsub("Group", "", obs) obs <- unlist(strsplit(trimws(obs), "\\s+")) if (isTRUE(length(obs) %% 2 == 0)) { - Observations <- as.numeric(obs[seq(3, to = length(obs), by = 3)]) - names(Observations) <- obs[seq(1, to = length(obs), by = 3)] + Observations <- as.numeric(obs[seq(2, to = length(obs), by = 2)]) + names(Observations) <- obs[seq(1, to = length(obs), by = 2)] attr(allFiles[[listID]]$summaries, "Observations") <- Observations } }