Skip to content

Commit e1eeff3

Browse files
committed
cor table formatting changed, ~~ fobidden
1 parent a8749c8 commit e1eeff3

File tree

2 files changed

+22
-20
lines changed

2 files changed

+22
-20
lines changed

R/plssem.R

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
PLSSEMInternal <- function(jaspResults, dataset, options, ...) {
1919
jaspResults$addCitation("Rademaker ME, Schuberth F (2020). cSEM: Composite-Based Structural Equation Modeling. Package version: 0.4.0, https://m-e-rademaker.github.io/cSEM/.")
2020

21+
sink(file="~/Downloads/log.txt")
22+
on.exit(sink(NULL))
2123

2224
options <- .plsSemPrepOpts(options)
2325

@@ -124,8 +126,9 @@ checkCSemModel <- function(model, availableVars) {
124126
if (inherits(parsed, "try-error")) {
125127

126128
msg <- attr(parsed, "condition")$message
129+
127130
if (msg == "NA/NaN argument") {
128-
return("Enter a model")
131+
return(gettext("Enter a model"))
129132
}
130133
return(stringr::str_replace_all(msg, unvvars))
131134
}
@@ -139,12 +142,16 @@ checkCSemModel <- function(model, availableVars) {
139142
modelVarsInAvailableVars <- (modelVars %in% vvars)
140143
if (!all(modelVarsInAvailableVars)) {
141144
notRecognized <- modelVars[!modelVarsInAvailableVars]
142-
return(paste("Variable(s) in model syntax not recogzed:",
143-
paste(stringr::str_replace_all(notRecognized, unvvars),
144-
collapse = ", ")))
145+
return(gettextf("Variable(s) in model syntax not recognized: %s",
146+
paste(stringr::str_replace_all(notRecognized, unvvars), collapse = ", ")))
145147
}
146148
}
147149

150+
# check for '~~'
151+
if (grepl("~~", vmodel)) {
152+
return(gettext("Using '~~' is not supported. Try '~' instead"))
153+
}
154+
148155
# if checks pass, return empty string
149156
return("")
150157
}
@@ -517,7 +524,7 @@ checkCSemModel <- function(model, availableVars) {
517524
if (!is.null(modelContainer[["params"]])) return()
518525

519526
# create container for parameter estimates
520-
params <- createJaspContainer(gettext("Parameter estimates"))
527+
params <- createJaspContainer(gettext("Parameter Estimates"))
521528
params$position <- 1
522529
params$dependOn(c("models", "ciLevel"))
523530

@@ -616,7 +623,7 @@ checkCSemModel <- function(model, availableVars) {
616623
pecont[["path"]] <- pathTab
617624

618625
# create total effects table
619-
totalTab <- createJaspTable(title = gettext("Total effects"))
626+
totalTab <- createJaspTable(title = gettext("Total Effects"))
620627

621628
if (options[["group"]] != "")
622629
totalTab$addColumnInfo(name = "group", title = gettext("Group"), type = "string", combine = TRUE)
@@ -1789,7 +1796,7 @@ checkCSemModel <- function(model, availableVars) {
17891796
oictab[["rownames"]] <- rownames(oic)
17901797
}
17911798
nm <- colnames(oic)[i]
1792-
oictab$addColumnInfo(nm, title = nm, type = "pvalue")
1799+
oictab$addColumnInfo(nm, title = nm, type = "number")
17931800
oictab[[nm]] <- oic[,i]
17941801
}
17951802
}
@@ -1805,7 +1812,7 @@ checkCSemModel <- function(model, availableVars) {
18051812
iictab[["rownames"]] <- rownames(iic)
18061813
}
18071814
nm <- colnames(iic)[i]
1808-
iictab$addColumnInfo(nm, title = nm, type = "pvalue")
1815+
iictab$addColumnInfo(nm, title = nm, type = "number")
18091816
iictab[[nm]] <- iic[,i]
18101817
}
18111818
}
@@ -1821,7 +1828,7 @@ checkCSemModel <- function(model, availableVars) {
18211828
occtab[["rownames"]] <- rownames(occ)
18221829
}
18231830
nm <- colnames(occ)[i]
1824-
occtab$addColumnInfo(nm, title = nm, type = "pvalue")
1831+
occtab$addColumnInfo(nm, title = nm, type = "number")
18251832
occtab[[nm]] <- occ[,i]
18261833
}
18271834
}
@@ -1837,7 +1844,7 @@ checkCSemModel <- function(model, availableVars) {
18371844
icctab[["rownames"]] <- rownames(icc)
18381845
}
18391846
nm <- colnames(icc)[i]
1840-
icctab$addColumnInfo(nm, title = nm, type = "pvalue")
1847+
icctab$addColumnInfo(nm, title = nm, type = "number")
18411848
icctab[[nm]] <- icc[,i]
18421849
}
18431850
}
@@ -1863,7 +1870,7 @@ checkCSemModel <- function(model, availableVars) {
18631870
oiccont[[groupNames[i]]][["rownames"]] <- rownames(oic)
18641871
}
18651872
nm <- colnames(oic)[j]
1866-
oiccont[[groupNames[i]]]$addColumnInfo(nm, title = nm, type = "pvalue")
1873+
oiccont[[groupNames[i]]]$addColumnInfo(nm, title = nm, type = "number")
18671874
oiccont[[groupNames[i]]][[nm]] <- oic[,j]
18681875
}
18691876
}
@@ -1888,7 +1895,7 @@ checkCSemModel <- function(model, availableVars) {
18881895
iiccont[[groupNames[i]]][["rownames"]] <- rownames(iic)
18891896
}
18901897
nm <- colnames(iic)[j]
1891-
iiccont[[groupNames[i]]]$addColumnInfo(nm, title = nm, type = "pvalue")
1898+
iiccont[[groupNames[i]]]$addColumnInfo(nm, title = nm, type = "number")
18921899
iiccont[[groupNames[i]]][[nm]] <- iic[,j]
18931900
}
18941901
}
@@ -1911,7 +1918,7 @@ checkCSemModel <- function(model, availableVars) {
19111918
occcont[[groupNames[i]]][["rownames"]] <- rownames(occ)
19121919
}
19131920
nm <- colnames(occ)[j]
1914-
occcont[[groupNames[i]]]$addColumnInfo(nm, title = nm, type = "pvalue")
1921+
occcont[[groupNames[i]]]$addColumnInfo(nm, title = nm, type = "number")
19151922
occcont[[groupNames[i]]][[nm]] <- occ[,j]
19161923
}
19171924
}
@@ -1936,7 +1943,7 @@ checkCSemModel <- function(model, availableVars) {
19361943
icccont[[groupNames[i]]][["rownames"]] <- rownames(icc)
19371944
}
19381945
nm <- colnames(icc)[j]
1939-
icccont[[groupNames[i]]]$addColumnInfo(nm, title = nm, type = "pvalue")
1946+
icccont[[groupNames[i]]]$addColumnInfo(nm, title = nm, type = "number")
19401947
icccont[[groupNames[i]]][[nm]] <- icc[,j]
19411948
}
19421949
}

inst/qml/PLSSEM.qml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ Form
2929
{
3030
id: models
3131
name: "models"
32-
maximumItems: 9
33-
newItemName: qsTr("Model 1")
34-
optionKey: "name"
32+
maximumItems: 1
3533

3634
content: TextArea { name: "syntax"; width: models.width; textType: JASP.TextTypeCSem; showLineNumber: true }
3735
}
@@ -131,9 +129,7 @@ Form
131129
enabled: errorCalcMethod.value == "bootstrap"
132130
}
133131
}
134-
135132
}
136-
}
137133
RadioButtonGroup
138134
{
139135
visible: errorCalcMethod.value != "none"
@@ -215,7 +211,6 @@ Form
215211
enabled: prediction.checked
216212
RadioButton { value: "none"; label: qsTr("None") ; checked: true }
217213
RadioButton { value: "lm"; label: qsTr("Linear model") }
218-
RadioButton { value: "PLS-PM"; label: qsTr("PLS-PM") }
219214
RadioButton { value: "GSCA"; label: qsTr("GSCA") }
220215
RadioButton { value: "PCA"; label: qsTr("PCA") }
221216
RadioButton { value: "MAXVAR"; label: qsTr("MAXVAR") }

0 commit comments

Comments
 (0)