Skip to content

Commit

Permalink
fixed CRAN check issues in code contributed by Manuel Arnold
Browse files Browse the repository at this point in the history
  • Loading branch information
brandmaier committed Apr 3, 2023
1 parent 8f659ac commit 77e70e3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/minus2logLik_from_fitted_models.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
minus2logLik_from_fitted_models <- function(x) {
if (class(x) %in% c("OpenMx", "MxRAMModel")) {
if (is(x,"OpenMx") || is(x,"MxRAMModel")) {
x$output$Minus2LogLikelihood
} else if (class(x) == "ctsemFit") {
} else if (is(x, "ctsemFit")) {
x$mxobj$output$Minus2LogLikelihood
} else if (class(x) == "lavaan") {
} else if (is(x,"lavaan")) {
-2*lavaan::logLik(x)
} else {
stop("minus2logLik_from_fitted_models() does not recognize the model")
Expand Down
5 changes: 5 additions & 0 deletions R/plotParDiffForest.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ plotParDiffForest <- function(forest, plot = "boxplot", measure = "wald",
df$Predictor <- factor(df$Predictor, ordered = TRUE,
levels = forest$covariates)

# stupid fix to stop CRAN from complaining (one possible way out could be aes_string())
Parameter <- NULL
Node <- NULL
Value <- NULL

# ballon
if (plot == "boxplot") {

Expand Down
5 changes: 5 additions & 0 deletions R/plotParDiffTree.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ plotParDiffTree <- function(tree, plot = "ballon", measure = "wald",

df$Parameter <- factor(df$Parameter, ordered = TRUE, levels = tree$param_names)

# stupid fix to stop CRAN from complaining (one possible way out could be aes_string())
Parameter <- NULL
Node <- NULL
Value <- NULL

# ballon
if (plot == "ballon") {
p <- ggplot2::ggplot(df, ggplot2::aes(x = Node, y = Parameter)) +
Expand Down

0 comments on commit 77e70e3

Please sign in to comment.