Skip to content

Commit 2048faa

Browse files
committed
Change class sem to mxsem as it conflicts with sem package
1 parent 638535b commit 2048faa

File tree

8 files changed

+44
-45
lines changed

8 files changed

+44
-45
lines changed

NAMESPACE

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ S3method(plot, character)
1515
S3method(plot, wls)
1616
S3method(plot, osmasem)
1717
S3method(plot, osmasem2)
18-
S3method(plot, sem)
18+
S3method(plot, mxsem)
1919
# S3method(plot, osmasem3L)
2020

2121
S3method(summary, wls)
@@ -31,7 +31,7 @@ S3method(summary, Cor3L)
3131
S3method(summary, bootuniR2)
3232
S3method(summary, osmasem)
3333
S3method(summary, osmasem2)
34-
S3method(summary, sem)
34+
S3method(summary, mxsem)
3535
# S3method(summary, osmasem3L)
3636
# S3method(summary, tssemRobust1)
3737

@@ -41,7 +41,7 @@ S3method(anova, wls)
4141
S3method(anova, reml)
4242
S3method(anova, osmasem)
4343
S3method(anova, osmasem2)
44-
S3method(anova, sem)
44+
S3method(anova, mxsem)
4545
# S3method(anova, osmasem3L)
4646

4747
S3method(coef, tssem1FEM)
@@ -54,7 +54,7 @@ S3method(coef, meta3LFIML)
5454
S3method(coef, reml)
5555
S3method(coef, osmasem)
5656
S3method(coef, osmasem2)
57-
S3method(coef, sem)
57+
S3method(coef, mxsem)
5858
# S3method(coef, osmasem3L)
5959
# S3method(coef, tssemRobust1)
6060

@@ -68,7 +68,7 @@ S3method(vcov, meta3LFIML)
6868
S3method(vcov, reml)
6969
S3method(vcov, osmasem)
7070
S3method(vcov, osmasem2)
71-
S3method(vcov, sem)
71+
S3method(vcov, mxsem)
7272
# S3method(vcov, osmasem3L)
7373
# S3method(vcov, tssemRobust1)
7474

@@ -89,7 +89,7 @@ S3method(print, uniR1)
8989
S3method(print, summary.CorPop)
9090
S3method(print, summary.Cor3L)
9191
S3method(print, summary.bootuniR2)
92-
S3method(print, summary.sem)
92+
S3method(print, summary.mxsem)
9393

9494
# required by R3.3
9595
importFrom("graphics", "abline", "arrows", "layout", "par", "plot",

R/sem.R

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ sem <- function(model.name="sem", RAM=NULL, data=NULL, Cov=NULL,
225225

226226
out <- list(mx.fit=mx.fit, RAM=RAM, data=data, mxalgebras=mxalgebras.ci,
227227
intervals.type=intervals.type)
228-
class(out) <- "sem"
228+
class(out) <- "mxsem"
229229
out
230230
}
231231

@@ -235,17 +235,17 @@ create.mxModel <- function(model.name="sem", RAM=NULL, data=NULL,
235235
intervals.type=c("z", "LB"), startvalues=NULL,
236236
replace.constraints=FALSE, mxModel.Args=NULL,
237237
run=TRUE, silent=TRUE, ...) {
238-
.Deprecated("create.mxModel")
238+
.Deprecated("sem")
239239
sem(model.name=model.name, RAM=RAM, data=data, Cov=Cov, means=means,
240240
numObs=numObs, intervals.type=intervals.type, startvalues=startvalues,
241241
replace.constraints=replace.constraints, mxModel.Args=mxModel.Args,
242242
run=run, silent=silent, ...)
243243
}
244244

245245

246-
summary.sem <- function(object, robust=FALSE, ...) {
247-
if (!is.element("sem", class(object)))
248-
stop("\"object\" must be an object of class \"sem\".")
246+
summary.mxsem <- function(object, robust=FALSE, ...) {
247+
if (!is.element("mxsem", class(object)))
248+
stop("\"object\" must be an object of class \"mxsem\".")
249249

250250
# calculate coefficients
251251
my.mx <- summary(object$mx.fit)
@@ -329,13 +329,13 @@ summary.sem <- function(object, robust=FALSE, ...) {
329329
Minus2LL=my.mx$Minus2LogLikelihood,
330330
Mx.status1=object$mx.fit@output$status[[1]],
331331
informationCriteria=informationCriteria)
332-
class(out) <- "summary.sem"
332+
class(out) <- "summary.mxsem"
333333
out
334334
}
335335

336-
print.summary.sem <- function(x, ...) {
337-
if (!is.element("summary.sem", class(x))) {
338-
stop("\"x\" must be an object of class \"summary.sem\".")
336+
print.summary.mxsem <- function(x, ...) {
337+
if (!is.element("summary.mxsem", class(x))) {
338+
stop("\"x\" must be an object of class \"summary.mxsem\".")
339339
}
340340

341341
cat("95% confidence intervals: ")
@@ -364,16 +364,15 @@ print.summary.sem <- function(x, ...) {
364364
if (!(x$Mx.status1 %in% c(0,1))) warning("OpenMx status1 is neither 0 or 1. You are advised to 'rerun' it again.\n")
365365
}
366366

367-
coef.sem <- function(object, ...) {
368-
if (!is.element("sem", class(object)))
369-
stop("\"object\" must be an object of class \"sem\".")
370-
367+
coef.mxsem <- function(object, ...) {
368+
if (!is.element("mxsem", class(object)))
369+
stop("\"object\" must be an object of class \"mxsem\".")
371370
coef(object$mx.fit)
372371
}
373372

374-
vcov.sem <- function(object, robust=FALSE, ...) {
375-
if (!is.element("sem", class(object)))
376-
stop("\"object\" must be an object of class \"sem\".")
373+
vcov.mxsem <- function(object, robust=FALSE, ...) {
374+
if (!is.element("mxsem", class(object)))
375+
stop("\"object\" must be an object of class \"mxsem\".")
377376

378377
if (robust) {
379378
suppressMessages(imxRobustSE(object$mx.fit, details=TRUE)$cov)
@@ -382,24 +381,24 @@ vcov.sem <- function(object, robust=FALSE, ...) {
382381
}
383382
}
384383

385-
anova.sem <- function(object, ..., all=FALSE) {
384+
anova.mxsem <- function(object, ..., all=FALSE) {
386385
base <- lapply(list(object), function(x) x$mx.fit)
387386
comparison <- lapply(list(...), function(x) x$mx.fit)
388387
mxCompare(base=base, comparison=comparison, all=all)
389388
}
390389

391-
plot.sem <- function(x, manNames=NULL, latNames=NULL,
392-
labels=c("labels", "RAM"), what="est", nCharNodes=0,
393-
nCharEdges=0, layout=c("tree", "circle", "spring",
394-
"tree2", "circle2"),
395-
sizeMan=8, sizeLat=8, edge.label.cex=1.3,
396-
color="white", weighted=FALSE, ...) {
390+
plot.mxsem <- function(x, manNames=NULL, latNames=NULL,
391+
labels=c("labels", "RAM"), what="est", nCharNodes=0,
392+
nCharEdges=0, layout=c("tree", "circle", "spring",
393+
"tree2", "circle2"),
394+
sizeMan=8, sizeLat=8, edge.label.cex=1.3,
395+
color="white", weighted=FALSE, ...) {
397396

398397
if (!requireNamespace("semPlot", quietly=TRUE))
399398
stop("\"semPlot\" package is required for this function.")
400399

401-
if (!inherits(x, "sem"))
402-
stop("'sem' object is required.\n")
400+
if (!inherits(x, "mxsem"))
401+
stop("'mxsem' object is required.\n")
403402

404403
A <- x$mx.fit@matrices$Amatrix$values
405404
S <- x$mx.fit@matrices$Smatrix$values

man/anova.Rd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
\alias{anova.reml}
66
\alias{anova.osmasem}
77
\alias{anova.osmasem2}
8-
\alias{anova.sem}
8+
\alias{anova.mxsem}
99
\title{Compare Nested Models with Likelihood Ratio Statistic
1010
}
1111
\description{It compares nested models with the likelihood ratio
@@ -18,7 +18,7 @@
1818
\method{anova}{reml}(object, \dots, all=FALSE)
1919
\method{anova}{osmasem}(object, \dots, all=FALSE)
2020
\method{anova}{osmasem2}(object, \dots, all=FALSE)
21-
\method{anova}{sem}(object, \dots, all=FALSE)
21+
\method{anova}{mxsem}(object, \dots, all=FALSE)
2222
}
2323
%- maybe also 'usage' for other objects documented here.
2424
\arguments{

man/coef.Rd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
\alias{coef.reml}
1010
\alias{coef.osmasem}
1111
\alias{coef.osmasem2}
12-
\alias{coef.sem}
12+
\alias{coef.mxsem}
1313

1414
\title{Extract Parameter Estimates from various classes.
1515
}
@@ -27,7 +27,7 @@
2727
\method{coef}{reml}(object, \dots)
2828
\method{coef}{osmasem}(object, select=c("fixed", "all", "random"), \dots)
2929
\method{coef}{osmasem2}(object, select=c("fixed", "all", "random"), \dots)
30-
\method{coef}{sem}(object, \dots)
30+
\method{coef}{mxsem}(object, \dots)
3131
}
3232
%- maybe also 'usage' for other objects documented here.
3333
\arguments{

man/plot.Rd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
\alias{plot.wls}
55
\alias{plot.osmasem}
66
\alias{plot.osmasem2}
7-
\alias{plot.sem}
7+
\alias{plot.mxsem}
88

99
\title{Plot methods for various objects
1010
}
@@ -48,7 +48,7 @@
4848
layout=c("tree", "circle", "spring", "tree2", "circle2"),
4949
sizeMan=8, sizeLat=8, edge.label.cex=1.3, color="white",
5050
weighted=FALSE, \dots)
51-
\method{plot}{sem}(x, manNames=NULL, latNames=NULL, labels=c("labels", "RAM"),
51+
\method{plot}{mxsem}(x, manNames=NULL, latNames=NULL, labels=c("labels", "RAM"),
5252
what="est", nCharNodes=0, nCharEdges=0,
5353
layout=c("tree", "circle", "spring", "tree2", "circle2"),
5454
sizeMan=8, sizeLat=8, edge.label.cex=1.3, color="white",

man/sem.Rd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ sem(model.name="sem", RAM=NULL, data=NULL,
4646
\item{\dots}{Further arguments will be passed to either
4747
\code{\link[OpenMx]{mxRun}} or \code{\link[OpenMx]{mxTryHard}}}
4848
}
49-
\value{An object of class \code{mxRAMmodel}}
49+
\value{An object of class \code{mxsem}}
5050
\note{when there are constraints with \code{replace.constraints=TRUE} and \code{intervals.type="LB"}, it returns an error because some parameters in the model are replaced with the new parameters in the constraints. However, the names of these new parameters are not captured in the CI object. Users are advised to use \code{intervals.type="z"} before it is fixed.
5151
}
5252
\author{Mike W.-L. Cheung <mikewlcheung@nus.edu.sg>

man/summary.Rd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
\alias{summary.bootuniR2}
1313
\alias{summary.osmasem}
1414
\alias{summary.osmasem2}
15-
\alias{summary.sem}
15+
\alias{summary.mxsem}
1616
\alias{print.summary.tssem1FEM}
1717
\alias{print.summary.tssem1FEM.cluster}
1818
\alias{print.summary.wls}
@@ -22,7 +22,7 @@
2222
\alias{print.summary.CorPop}
2323
\alias{print.summary.Cor3L}
2424
\alias{print.summary.bootuniR2}
25-
\alias{print.summary.sem}
25+
\alias{print.summary.mxsem}
2626
\title{Summary Method for tssem1, wls, meta, and meta3LFIML Objects
2727
}
2828
\description{It summaries results for various class.
@@ -36,7 +36,7 @@
3636
\method{summary}{meta}(object, homoStat=TRUE, robust=FALSE, \dots)
3737
\method{summary}{meta3LFIML}(object, allX=FALSE, robust=FALSE, \dots)
3838
\method{summary}{reml}(object, \dots)
39-
\method{summary}{sem}(object, robust=FALSE, \dots)
39+
\method{summary}{mxsem}(object, robust=FALSE, \dots)
4040
\method{summary}{CorPop}(object, \dots)
4141
\method{summary}{Cor3L}(object, \dots)
4242
\method{summary}{bootuniR2}(object, probs=c(0, 0.1, 0.5, 0.9, 1),
@@ -49,7 +49,7 @@
4949
\method{print.summary}{meta}(x, \dots)
5050
\method{print.summary}{meta3LFIML}(x, \dots)
5151
\method{print.summary}{reml}(x, \dots)
52-
\method{print.summary}{sem}(x, \dots)
52+
\method{print.summary}{mxsem}(x, \dots)
5353
\method{print.summary}{CorPop}(x, \dots)
5454
\method{print.summary}{Cor3L}(x, \dots)
5555
\method{print.summary}{bootuniR2}(x, \dots)
@@ -58,7 +58,7 @@
5858
\item{object}{An object returned from either class
5959
\code{tssem1FEM}, class \code{tssem1FEM.cluster},
6060
class \code{tssem1REM}, class \code{wls}, class \code{wls.cluster},
61-
class \code{meta}, class \code{meta3LFIML}, class \code{reml} or class \code{CorPop}.
61+
class \code{meta}, class \code{meta3LFIML}, class \code{reml}, class \code{mxsem} or class \code{CorPop}.
6262
}
6363
\item{x}{An object returned from either class \code{summary.tssem1FEM},
6464
class \code{tssem1FEM.cluster}, class \code{summary.wls}, class

man/vcov.Rd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
\alias{vcov.reml}
1010
\alias{vcov.osmasem}
1111
\alias{vcov.osmasem2}
12-
\alias{vcov.sem}
12+
\alias{vcov.mxsem}
1313
\title{Extract Covariance Matrix Parameter Estimates from Objects of
1414
Various Classes
1515
}
@@ -27,7 +27,7 @@
2727
\method{vcov}{reml}(object, \dots)
2828
\method{vcov}{osmasem}(object, select=c("fixed", "all", "random"), robust=FALSE, \dots)
2929
\method{vcov}{osmasem2}(object, select=c("fixed", "all", "random"), robust=FALSE, \dots)
30-
\method{vcov}{sem}(object, robust=FALSE, \dots)
30+
\method{vcov}{mxsem}(object, robust=FALSE, \dots)
3131
}
3232
%- maybe also 'usage' for other objects documented here.
3333
\arguments{

0 commit comments

Comments
 (0)