Hello Dr. Cheung and Dr. Lai,
This is a really cool and helpful package for customizing plots of path models in a convenient way with huge flexibility.
I was testing out this package with an output from a multigroup confirmatory factor analysis model which contains two path models of two groups of gender. The semPlot object contains two lists and the functions of semptools do not seem to handle semPlot objects with more than one list.
For example, after fitting a configural model into the data
configural_fit <- cfa(model = model_helpful,
data = helpful,
estimator = "WLSMV",
ordered = c(paste0("H", 1:7)),
group = "gender",
meanstructure = TRUE,
parameterization = "theta")
summary(configural_fit)
and plotting the path models via semPaths, which yields two plots,
conf_pa <- semPaths(configural_fit, whatLabels = "est",
nCharNodes = 0, nCharEdges = 0)
passing through the object "conf_pa"
conf_pa_ast <- mark_sig(conf_pa, configural_fit)
plot(conf_pa_ast)
will yield an error message as shown below.
rlang::last_error()
<error/rlang_error_data_pronoun_not_found>
Column from_names not found in .data
Backtrace:
- semptools::mark_sig(conf_pa, configural_fit)
- rlang:::abort_data_pronoun(x)
rlang::last_trace()
<error/rlang_error_data_pronoun_not_found>
Column from_names not found in .data
Backtrace:
█
- ├─semptools::mark_sig(conf_pa, configural_fit)
- │ ├─dplyr::select(...)
- │ └─dplyr:::select.data.frame(...)
- │ └─tidyselect::vars_select(tbl_vars(.data), !!!enquos(...))
- │ └─tidyselect:::eval_select_impl(...)
- │ ├─tidyselect:::with_subscript_errors(...)
- │ │ ├─base::tryCatch(...)
- │ │ │ └─base:::tryCatchList(expr, classes, parentenv, handlers)
- │ │ │ └─base:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
- │ │ │ └─base:::doTryCatch(return(expr), name, parentenv, handler)
- │ │ └─tidyselect:::instrument_base_errors(expr)
- │ │ └─base::withCallingHandlers(...)
- │ └─tidyselect:::vars_select_eval(...)
- │ └─tidyselect:::walk_data_tree(expr, data_mask, context_mask)
- │ └─tidyselect:::eval_c(expr, data_mask, context_mask)
- │ └─tidyselect:::reduce_sels(node, data_mask, context_mask, init = init)
- │ └─tidyselect:::walk_data_tree(new, data_mask, context_mask)
- │ └─base::eval(expr, data_mask)
- │ └─base::eval(expr, data_mask)
- │ ├─from_names
- │ └─rlang:::
$.rlang_data_pronoun(.data, from_names)
- │ └─rlang:::data_pronoun_get(x, nm)
- └─rlang:::abort_data_pronoun(x)
If the lists inside of "conf_pa" are read one by one (e.g., by specifying conf_pa[[1]]), functions in this package work well.
conf_pa_ast <- mark_sig(conf_pa[[1]], configural_fit)
plot(conf_pa_ast)
Hello Dr. Cheung and Dr. Lai,
This is a really cool and helpful package for customizing plots of path models in a convenient way with huge flexibility.
I was testing out this package with an output from a multigroup confirmatory factor analysis model which contains two path models of two groups of gender. The semPlot object contains two lists and the functions of semptools do not seem to handle semPlot objects with more than one list.
For example, after fitting a configural model into the data
and plotting the path models via semPaths, which yields two plots,
passing through the object "conf_pa"
will yield an error message as shown below.
If the lists inside of "conf_pa" are read one by one (e.g., by specifying conf_pa[[1]]), functions in this package work well.