Skip to content

Commit

Permalink
Update create.mxModel
Browse files Browse the repository at this point in the history
  • Loading branch information
mikewlcheung committed Apr 8, 2024
1 parent a4bc650 commit b279e06
Show file tree
Hide file tree
Showing 56 changed files with 789 additions and 503 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: metaSEM
Type: Package
Title: Meta-Analysis using Structural Equation Modeling
Version: 1.3.1
Date: 2023-08-08
Version: 1.4.0
Date: 2024-04-08
Depends: R (>= 3.4.0), OpenMx
Imports: Matrix, MASS, ellipse, graphics, stats, utils, mvtnorm, numDeriv, lavaan
Suggests: metafor, semPlot, R.rsp, testthat, matrixcalc
Expand Down
8 changes: 6 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ S3method(plot, meta)
S3method(plot, character)
S3method(plot, wls)
S3method(plot, osmasem)
S3method(plot, mxRAMmodel)
# S3method(plot, osmasem3L)

S3method(summary, wls)
Expand All @@ -28,6 +29,7 @@ S3method(summary, CorPop)
S3method(summary, Cor3L)
S3method(summary, bootuniR2)
S3method(summary, osmasem)
S3method(summary, mxRAMmodel)
# S3method(summary, osmasem3L)
# S3method(summary, tssemRobust1)

Expand All @@ -36,6 +38,7 @@ S3method(anova, meta3LFIML)
S3method(anova, wls)
S3method(anova, reml)
S3method(anova, osmasem)
S3method(anova, mxRAMmodel)
# S3method(anova, osmasem3L)

S3method(coef, tssem1FEM)
Expand All @@ -46,8 +49,8 @@ S3method(coef, tssem1REM)
S3method(coef, meta)
S3method(coef, meta3LFIML)
S3method(coef, reml)
S3method(coef, MxRAMModel)
S3method(coef, osmasem)
S3method(coef, mxRAMmodel)
# S3method(coef, osmasem3L)
# S3method(coef, tssemRobust1)

Expand All @@ -59,8 +62,8 @@ S3method(vcov, tssem1REM)
S3method(vcov, meta)
S3method(vcov, meta3LFIML)
S3method(vcov, reml)
S3method(vcov, MxRAMModel)
S3method(vcov, osmasem)
S3method(vcov, mxRAMmodel)
# S3method(vcov, osmasem3L)
# S3method(vcov, tssemRobust1)

Expand All @@ -81,6 +84,7 @@ S3method(print, uniR1)
S3method(print, summary.CorPop)
S3method(print, summary.Cor3L)
S3method(print, summary.bootuniR2)
S3method(print, summary.mxRAMmodel)

# required by R3.3
importFrom("graphics", "abline", "arrows", "layout", "par", "plot",
Expand Down
5 changes: 5 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Release 1.4.0 (Apr 8, 2024)
====================================
* Revise create.mxModel().
* Replace dontrun with donttest.

Release 1.3.1 (Aug 8, 2023)
====================================
* Lower the tolerance in testing asyCov(), which returns an error in latest R.
Expand Down
16 changes: 9 additions & 7 deletions R/as.mxMatrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,16 @@ as.mxMatrix <- function(x, name, ...) {
}

as.symMatrix <- function(x) {
if (is.list(x)) {
for (i in seq_along(x)) {
x[[i]][] <- vapply(x[[i]], function(z) gsub(".*\\*", "", z), character(1))
}
} else {
x[] <- vapply(x, function(z) gsub(".*\\*", "", z), character(1))
if (is.list(x)) {
## for (i in seq_along(x)) {
## Exclude mxalgebras, which creates troubles
for (i in c("A", "S", "F", "M")) {
x[[i]][] <- vapply(x[[i]], function(z) gsub(".*\\*", "", z), character(1))
}
x
} else {
x[] <- vapply(x, function(z) gsub(".*\\*", "", z), character(1))
}
x
}

as.mxAlgebra <- function(x, startvalues=NULL, name="X") {
Expand Down
Loading

0 comments on commit b279e06

Please sign in to comment.