Skip to content

Commit

Permalink
Remove insistence that syntax be a single string in mplus2lavaan.mode…
Browse files Browse the repository at this point in the history
…lSyntax; broke mplus2lavaan conversion
  • Loading branch information
michaelhallquist committed Apr 23, 2020
1 parent 8d4bdd4 commit c56da07
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions R/ctr_mplus2lavaan.R
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,11 @@ mplus2lavaan.constraintSyntax <- function(syntax) {
}

mplus2lavaan.modelSyntax <- function(syntax) {
if (length(syntax) > 1L) { stop("mplus2lavaan.modelSyntax syntax argument should be a single string, not a vector") }
if (!is.character(syntax)) { stop("mplus2lavaan.modelSyntax accepts a single character string containing all model syntax") }
if (is.character(syntax)) {
if (length(syntax) > 1L) { syntax <- paste(syntax, collapse="\n") } #concatenate into a long string separated by newlines
} else {
stop("mplus2lavaan.modelSyntax accepts a single character string or character vector containing all model syntax")
}

#because this is now exposed as a function in the package, handle the case of the user passing in full .inp file as text
#we should only be interested in the MODEL and MODEL CONSTRAINT sections
Expand Down

0 comments on commit c56da07

Please sign in to comment.