Skip to contents

Print the content of 'all_paths'-class object, which can be generated by all_indirect_paths().

Usage

# S3 method for class 'all_paths'
print(x, ...)

Arguments

x

A 'all_paths'-class object.

...

Optional arguments.

Value

x is returned invisibly. Called for its side effect.

Details

This function is used to print the paths identified in a readable format.

Examples

library(lavaan)
data(data_serial_parallel)
mod <-
"
m11 ~ x + c1 + c2
m12 ~ m11 + x + c1 + c2
m2 ~ x + c1 + c2
y ~ m12 + m2 + m11 + x + c1 + c2
"
fit <- sem(mod, data_serial_parallel,
           fixed.x = FALSE)
# All indirect paths
out1 <- all_indirect_paths(fit)
out1
#> Call: 
#> all_indirect_paths(fit = fit)
#> Path(s): 
#>    path                 
#> 1  m11 -> m12 -> y      
#> 2  x -> m11 -> m12      
#> 3  x -> m11 -> m12 -> y 
#> 4  x -> m11 -> y        
#> 5  x -> m12 -> y        
#> 6  x -> m2 -> y         
#> 7  c1 -> m11 -> m12     
#> 8  c1 -> m11 -> m12 -> y
#> 9  c1 -> m11 -> y       
#> 10 c1 -> m12 -> y       
#> 11 c1 -> m2 -> y        
#> 12 c2 -> m11 -> m12     
#> 13 c2 -> m11 -> m12 -> y
#> 14 c2 -> m11 -> y       
#> 15 c2 -> m12 -> y       
#> 16 c2 -> m2 -> y