Skip to content

Commit

Permalink
fix small issue
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Thorson committed Jan 18, 2024
1 parent 74c7203 commit 875a7fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ importFrom(TMB,sdreport)
importFrom(ape,Ntip)
importFrom(ape,node.depth.edgelength)
importFrom(ape,rtree)
importFrom(methods,is)
importFrom(phylobase,phylo4d)
importFrom(phylopath,average_DAGs)
importFrom(phylopath,coef_plot)
Expand Down
5 changes: 3 additions & 2 deletions R/phylosem.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#' @importFrom phylobase phylo4d
#' @importFrom ape Ntip node.depth.edgelength rtree
#' @importFrom TMB compile dynlib MakeADFun sdreport
#' @importFrom methods is
#'
#' @return
#' An object (list) of class `phylosem`. Elements include:
Expand Down Expand Up @@ -241,13 +242,13 @@ function( sem,
specifyModel( text=sem, exog.variances=TRUE, endog.variances=TRUE, covs=covs, quiet=control$quiet ),
error = function(e) e
)
if( isFALSE("semmod" %in% class(SEM_model)) ){
if( isFALSE(is(SEM_model,"semmod")) ){
SEM_model = tryCatch(
specifyEquations( text=sem, exog.variances=TRUE, endog.variances=TRUE, covs=covs ),
error = function(e) e
)
}
if( isFALSE("semmod" %in% class(SEM_model)) ){
if( isFALSE(is(SEM_model,"semmod")) ){
stop("Must supply either input for `sem::specifyModel` or `sem::specifyEquations`")
}
RAM = build_ram( SEM_model, colnames(data) )
Expand Down

0 comments on commit 875a7fe

Please sign in to comment.