{"action":"created","issue":{"url":"https://api.github.com/repos/SachaEpskamp/semPlot/issues/5","labels_url":"https://api.github.com/repos/SachaEpskamp/semPlot/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/SachaEpskamp/semPlot/issues/5/comments","events_url":"https://api.github.com/repos/SachaEpskamp/semPlot/issues/5/events","html_url":"https://github.com/SachaEpskamp/semPlot/issues/5","id":107782277,"number":5,"title":"semPaths with equality constraints","user":{"login":"schoam4","id":1619350,"avatar_url":"https://avatars.githubusercontent.com/u/1619350?v=3","gravatar_id":"","url":"https://api.github.com/users/schoam4","html_url":"https://github.com/schoam4","followers_url":"https://api.github.com/users/schoam4/followers","following_url":"https://api.github.com/users/schoam4/following{/other_user}","gists_url":"https://api.github.com/users/schoam4/gists{/gist_id}","starred_url":"https://api.github.com/users/schoam4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schoam4/subscriptions","organizations_url":"https://api.github.com/users/schoam4/orgs","repos_url":"https://api.github.com/users/schoam4/repos","events_url":"https://api.github.com/users/schoam4/events{/privacy}","received_events_url":"https://api.github.com/users/schoam4/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-22T19:18:48Z","updated_at":"2015-11-06T11:17:19Z","closed_at":null,"body":"There seems to be an issue with semPaths when using a model with equality constraints. Here's an example with the HS data from lavaan:\r\n\r\n#Original model, works fine\r\nHS.model <- ' visual  =~ x1 + x2 + x3\r\n              textual =~ x4 + x5 + x6\r\nspeed   =~ x7 + x8 + x9 '\r\n\r\nfit <- cfa(HS.model, data=HolzingerSwineford1939, std.lv = TRUE)\r\nsummary(fit, fit.measures=TRUE)\r\nsemPaths(fit)\r\n\r\n#Add equality constraint, get an error with semPaths\r\nHS.modelEQ <- ' visual  =~ l1*x1 + x2 + x3\r\n              textual =~ l1*x4 + x5 + x6\r\nspeed   =~ x7 + x8 + x9 '\r\n\r\nfitEQ <- cfa(HS.modelEQ, data=HolzingerSwineford1939, std.lv = TRUE)\r\nsummary(fitEQ, fit.measures=TRUE)\r\nsemPaths(fitEQ)\r\n\r\nError in data.frame(label = pars$label, lhs = ifelse(pars$op == \"~\" |  : \r\n  arguments imply differing number of rows: 24, 1, 25\r\n\r\nI've included the session info from R too, if there's something with my setup, please let me know!\r\n\r\nOne guess is that the \"great equality constraint switch\" in lavaan is causing the issue (http://lavaan.ugent.be/notes/lavaan_eq_constraints.pdf).\r\n\r\nAlex\r\n\r\n> sessionInfo()\r\nR version 3.2.1 (2015-06-18)\r\nPlatform: i386-w64-mingw32/i386 (32-bit)\r\nRunning under: Windows 7 (build 7601) Service Pack 1\r\n\r\nlocale:\r\n[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   \r\n[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          \r\n[5] LC_TIME=English_United States.1252    \r\n\r\nattached base packages:\r\n[1] stats     graphics  grDevices utils     datasets  methods   base     \r\n\r\nother attached packages:\r\n[1] lavaan_0.5-18 shiny_0.12.2  semPlot_1.0.1\r\n\r\nloaded via a namespace (and not attached):\r\n [1] Rcpp_0.12.1         Formula_1.2-1       lisrelToR_0.1.4     whisker_0.3-2       magrittr_1.5       \r\n [6] cluster_2.0.3       MASS_7.3-44         splines_3.2.1       mnormt_1.5-3        xtable_1.7-4       \r\n[11] ellipse_0.3-8       colorspace_1.2-6    lattice_0.20-33     huge_1.2.7          R6_2.1.1           \r\n[16] quadprog_1.5-5      jpeg_0.1-8          qgraph_1.3.1        mi_1.0              d3Network_0.5.2.1  \r\n[21] tcltk_3.2.1         parallel_3.2.1      latticeExtra_0.6-26 coda_0.17-1         sna_2.3-2          \r\n[26] DiagrammeR_0.7      corpcor_1.6.8       gtools_3.5.0        MatrixModels_0.4-1  htmltools_0.2.6    \r\n[31] lme4_1.1-9          abind_1.4-3         digest_0.6.8        Matrix_1.2-2        rockchalk_1.8.92   \r\n[36] acepack_1.3-3.3     scales_0.3.0        Hmisc_3.17-0        tables_0.7.79       boot_1.3-17        \r\n[41] stats4_3.2.1        jsonlite_0.9.17     httpuv_1.3.3        igraph_1.0.1        rstudioapi_0.3.1   \r\n[46] munsell_0.4.2       fdrtool_1.2.15      pbivnorm_0.6.0      ggm_2.3             arm_1.8-6          \r\n[51] sem_3.1-6           rjson_0.2.15        minqa_1.2.4         plyr_1.8.3          stringr_1.0.0      \r\n[56] car_2.1-0           matrixcalc_1.0-3    tools_3.2.1         grid_3.2.1          nnet_7.3-11        \r\n[61] pbkrtest_0.4-2      nlme_3.1-122        gtable_0.1.2        mgcv_1.8-7          quantreg_5.19      \r\n[66] png_0.1-7           psych_1.5.8         survival_2.38-3     gridExtra_2.0.0     ggplot2_1.0.1      \r\n[71] nloptr_1.0.4        reshape2_1.4.1      RColorBrewer_1.1-2  htmlwidgets_0.5     rpart_4.1-10       \r\n[76] mime_0.4            stringi_0.5-5       XML_3.98-1.3        SparseM_1.7         foreign_0.8-66     \r\n[81] glasso_1.8          proto_0.3-10       "},"comment":{"url":"https://api.github.com/repos/SachaEpskamp/semPlot/issues/comments/154384066","html_url":"https://github.com/SachaEpskamp/semPlot/issues/5#issuecomment-154384066","issue_url":"https://api.github.com/repos/SachaEpskamp/semPlot/issues/5","id":154384066,"user":{"login":"SimonStuber","id":11269398,"avatar_url":"https://avatars.githubusercontent.com/u/11269398?v=3","gravatar_id":"","url":"https://api.github.com/users/SimonStuber","html_url":"https://github.com/SimonStuber","followers_url":"https://api.github.com/users/SimonStuber/followers","following_url":"https://api.github.com/users/SimonStuber/following{/other_user}","gists_url":"https://api.github.com/users/SimonStuber/gists{/gist_id}","starred_url":"https://api.github.com/users/SimonStuber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimonStuber/subscriptions","organizations_url":"https://api.github.com/users/SimonStuber/orgs","repos_url":"https://api.github.com/users/SimonStuber/repos","events_url":"https://api.github.com/users/SimonStuber/events{/privacy}","received_events_url":"https://api.github.com/users/SimonStuber/received_events","type":"User","site_admin":false},"created_at":"2015-11-06T11:17:19Z","updated_at":"2015-11-06T11:17:19Z","body":"Thank you for reporting the problem. This issue will be fixed in the upcoming update of semPlot. In the meantime you can try to install the developmental version from github:\r\n\r\nlibrary('devtools')\r\ninstall_github('semPlot','SachaEpskamp')\r\n\r\nThis should solve the problem for now. Let me know if that works. \r\n\r\nBest,\r\nSimon"}}