cjvanlissa / tidySEM

55 stars 7 forks source link

digits argument not respected by `table_results` #12

Closed mattansb closed 3 years ago

mattansb commented 3 years ago

Might be related to #10 ?

library(lavaan)
#> This is lavaan 0.6-7
#> lavaan is BETA software! Please report any bugs.
library(tidySEM)

fit <- sem("mpg ~ cyl\nmpg ~ am", data = mtcars)

table_results(fit, columns = c("label", "est_std", "confint"), digits = 3)
#>           label    est_std        confint
#> 1    mpg.ON.cyl -0.7410906 [-3.17, -1.83]
#> 2     mpg.ON.am  0.2125333   [0.16, 4.98]
#> 3 Variances.mpg  0.2409864  [4.32, 12.64]
#> 4 Variances.cyl  1.0000000   [3.09, 3.09]
#> 5   cyl.WITH.am -0.5226070 [-0.45, -0.45]
#> 6  Variances.am  1.0000000   [0.24, 0.24]

Created on 2020-10-14 by the reprex package (v0.3.0)

cjvanlissa commented 3 years ago

@mattansb thank you, this should be easy to fix. Once the digits argument works for table_results() it will automatically work for graph_sem, although to override the default rounding would still require manual involvement. I will check if it's possible to pass on arguments to table_results.

mattansb commented 3 years ago

Thanks @cjvanlissa !

These few minor issues (#7, #10, maybe #11 and #14) are preventing me from switching over to your (excellent!) package in my SEM teaching (from the semPlot package, which I find too clunky for default pretty plots). Hope they are resolved soon!

cjvanlissa commented 3 years ago

Fixed by 2d7ef2a