linetype doe not accept ggplot acceptable types?
Closed this issue · 3 comments
mattansb commented
edges(g) <- edges(g) %>%
linetype_nonsig("dashed")
plot(g)
#> Error in grid.Call.graphics(C_lines, x$x, x$y, index, x$arrow) :
#> invalid line type: must be length 2, 4, 6 or 8
cjvanlissa commented
mattansb commented
It's because all the edges are sig in your example:
library(lavaan)
#> This is lavaan 0.6-7
#> lavaan is BETA software! Please report any bugs.
library(tidySEM)
#> Registered S3 methods overwritten by 'tidySEM':
#> method from
#> print.mplus.model MplusAutomation
#> print.mplusObject MplusAutomation
#> summary.mplus.model MplusAutomation
library(magrittr)
fit <- sem("mpg ~ cyl\nmpg ~ am", data = mtcars, meanstructure = TRUE)
g <- prepare_graph(fit)
edges(g) <- edges(g) %>%
linetype_cov("dashed")
plot(g)
#> Error in grid.Call.graphics(C_lines, x$x, x$y, index, x$arrow): invalid line type: must be length 2, 4, 6 or 8
Created on 2021-03-08 by the reprex package (v1.0.0)
cjvanlissa commented
Pretty poor design choice on the side of ggplot to accept both numeric or character linetypes, but then to strictly enforce the type...