Skip to content

Commit

Permalink
Add arguments to zz_arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
FloSchuberth committed Feb 1, 2025
1 parent 9282d3a commit 7063cf0
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 21 deletions.
26 changes: 10 additions & 16 deletions R/postestimate_plotModel.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@
#' )
#'
#' @inheritParams csem_arguments
#' @param .title Character string. Plot title.
#' @param .graph_attrs Character String. attributes that should be passed to the DiagrammeR syntax, e.g., c("rankdir=LR", "ranksep=1.0")). DiagrammeR syntax.
#'
#'
#' @return A DiagrammeR graph object or a list of DiagrammeR graph objects in case of a multi analysis.
#' @return A DiagrammeR graph object or a list of DiagrammeR graph objects in case of a multigroup analysis.
#'
#' @seealso [csem()], [cSEMResults], \link[DiagrammeR]{grViz}
#'
Expand All @@ -28,25 +26,25 @@

plotModel <- function(
.object,
.title = "",
.title = args_default()$.title,
.plot_significances = args_default()$.plot_significances,
.plot_indicator_correlations = args_default()$.plot_indicator_correlations,
.plot_structural_model_only = args_default()$.plot_structural_model_only,
.graph_attrs = NULL
) {
.graph_attrs = args_default()$.graph_attrs
){
UseMethod("plotModel")
}

#'@export

plotModel.cSEMResults_default <- function(
.object,
.title = "",
.title = args_default()$.title,
.plot_significances = args_default()$.plot_significances,
.plot_indicator_correlations = args_default()$.plot_indicator_correlations,
.plot_structural_model_only = args_default()$.plot_structural_model_only,
.graph_attrs = NULL
){
.graph_attrs = args_default()$.graph_attrs
){

if (inherits(.object, "cSEMResults_multi")) {
plots <- lapply(names(.object), function(group_name) {
Expand Down Expand Up @@ -108,17 +106,13 @@ plotModel.cSEMResults_default <- function(

plotModel.cSEMResults_2ndorder <- function(
.object,
.title = "",
.plot_significances = args_default()$.plot_significances,
.title = args_default()$.title,
.plot_significances = args_default()$.plot_significances,
.plot_indicator_correlations = args_default()$.plot_indicator_correlations,
.plot_structural_model_only = args_default()$.plot_structural_model_only,
.graph_attrs = NULL
.graph_attrs = args_default()$.graph_attrs
){

if (!inherits(.object, "cSEMResults_2ndorder")) {
stop2("plotModel2ndOrder requires a cSEMResults_2ndorder object.")
}

# Extract first– and second–stage models and summaries.
fs <- .object$First_stage
ss <- .object$Second_stage
Expand Down
5 changes: 5 additions & 0 deletions R/zz_arguments.R
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@
#' already?. Defaults to `FALSE`.
#' @param .full_output Logical. Should the full output of summarize be printed.
#' Defaults to `TRUE`.
#' @param .graph_attrs Character String. Additional attributes that should be passed
#' to the DiagrammeR syntax, e.g., c("rankdir=LR", "ranksep=1.0"). Defaults to *NULL*.
#' @param .H The (N x J) matrix of construct scores.
#' @param .handle_inadmissibles Character string. How should inadmissible results
#' be treated? One of "*drop*", "*ignore*", or "*replace*". If "*drop*", all
Expand Down Expand Up @@ -318,6 +320,7 @@
#' @param .testtype Character string. One of "*twosided*" (H1: The models do not
#' perform equally in predicting indicators belonging to endogenous constructs)"
#' and *onesided*" (H1: Model 1 performs better in predicting indicators belonging
#' @param .title Character string. Title of an object. Defaults to *NULL*.
#' @param .tolerance Double. The tolerance criterion for convergence.
#' Defaults to `1e-05`.
#' @param .treat_as_continuous Logical. Should the indicators for the benchmark predictions
Expand Down Expand Up @@ -486,6 +489,7 @@ args_default <- function(.choices = FALSE) {
.first_resample = NULL,
.force = FALSE,
.full_output = TRUE,
.graph_attrs = NULL,
.handle_inadmissibles = c("drop", "ignore", "replace"),
.H = NULL,
.id = NULL,
Expand Down Expand Up @@ -568,6 +572,7 @@ args_default <- function(.choices = FALSE) {
.steps_mod = NULL,
.terms = NULL,
.test_data = NULL,
.title = NULL,
.tolerance = 1e-05,
.treat_as_continuous = TRUE,
.type_gfi = c("ML", "GLS", "ULS"),
Expand Down
3 changes: 3 additions & 0 deletions man/buildDotCode.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion man/csem_arguments.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions man/plotModel.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7063cf0

Please sign in to comment.