alishinski / lavaanPlot

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

Improve argument order in the `lavaanPlot()`and `buildCall()` functions #34

Closed mccarthy-m-g closed 2 years ago

mccarthy-m-g commented 2 years ago

Currently the lavaanPlot() function has its arguments ordered like this:

lavaanPlot(name = "plot", model, labels = NULL, ...)

A huge improvement would be to order the arguments like this instead:

lavaanPlot(model, name = "plot", labels = NULL, ...)

The same change in argument order could also be made for the buildCall() function.

Having the model argument first is what most R users expect, since every function that takes a model object as input makes it its first argument. It would be great as an end-user if the lavaanPlot package followed this convention.

I'd be happy to file a PR if you're open to making this change!

alishinski commented 2 years ago

That is a good idea. I know there was a reason I didn't do it that way to begin with, but I can't remember what that is anymore, and I don't think it was a good reason. I made that change in the most recent commits.