alishinski / lavaanPlot

R package for plotting lavaan path models with DiagrammeR
http://alexlishinski.com/lavaanPlot/
38 stars 4 forks source link

Error #7

Closed ajvandam closed 6 years ago

ajvandam commented 6 years ago

First of all, lavaanPlot looks great and I hope it will work for me.

When I enter this code: lavaanPlot(model = m1_fit, labels = labels, node_options = list(shape = "box", fontname = "Helvetica"), edge_options = list(color = "grey"), coefs = TRUE, covs = TRUE)

I get an error: Error in lavaanPlot(model = m1_fit, labels = labels, node_options = list(shape = "box", : unused arguments (coefs = TRUE, covs = TRUE)

Any ideas what I am doing wrong?

Greetings,

Arjan

alishinski commented 6 years ago

I just tried your lavaanPlot call with an example from the vignette using the mtcars data and it worked correctly for me using lavaanPlot 0.5.1 downloaded from CRAN. Could you give me more info about your example? Did you download the package from CRAN or github?

ajvandam commented 6 years ago

Hi Alex,

Thanks! That was the problem! In my Rconsole, the packagemanager proposed an older version. Downloaded it directly from the CRAN-website, that did the job.

Now I am trying to attach the labels.

labels <- list(Map= "Mastery approach", Mav = "Mastery avoidance", Pap= "Performance approach", Pav = "Performance avoidance", Ms = "Mindset", Se = "Self efficacy")

lavaanPlot(model = m1_fit, labels = labels, node_options = list(shape = "box", fontname = "Helvetica"), edge_options = list(color = "grey"), coefs = TRUE, covs = TRUE)

The labels are neatly placed beside the model (see attachment). What am I missing here?

Vriendelijke groet,

Fidare Arjan van Dam

Heijermanslaan 27 1215 JL Hilversum 06-48865606 www.fidare.nl

2018-04-30 21:00 GMT+02:00 Alex Lishinski notifications@github.com:

I just tried your lavaanPlot call with an example from the vignette using the mtcars data and it worked correctly for me using lavaanPlot 0.5.1 downloaded from CRAN. Could you give me more info about your example? Did you download the package from CRAN or github?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alishinski/lavaanPlot/issues/7#issuecomment-385495937, or mute the thread https://github.com/notifications/unsubscribe-auth/AlDZyTRRYKPVJSKVe7rOMaKVDG2rrQJNks5tt185gaJpZM4TsSMs .

jorgesinval commented 6 years ago

Where is the attachment?

alishinski commented 6 years ago

Yeah, I don't see that attachment either. One thing to make sure of is that your named list of labels uses the exact same names for the variables to identify them as in the fit model. Other than that, if you show me the output you're getting I can advise further.

ajvandam commented 6 years ago

Hi,

Sorry, that was the problem, I did use capitals in the script and not in the call.... It works fine now!

Vriendelijke groet,

Fidare Arjan van Dam

Heijermanslaan 27 1215 JL Hilversum 06-48865606 www.fidare.nl

2018-05-01 17:17 GMT+02:00 Alex Lishinski notifications@github.com:

Yeah, I don't see that attachment either. One thing to make sure of is that your named list of labels uses the exact same names for the variables to identify them as in the fit model. Other than that, if you show me the output you're getting I can advise further.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alishinski/lavaanPlot/issues/7#issuecomment-385697017, or mute the thread https://github.com/notifications/unsubscribe-auth/AlDZyXUMgIO1uV219hpyishhy5M0Z0t3ks5tuHyIgaJpZM4TsSMs .