Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dealing with multiple assignment operator #13

Open
IndrajeetPatil opened this issue Nov 11, 2021 · 1 comment
Open

dealing with multiple assignment operator #13

IndrajeetPatil opened this issue Nov 11, 2021 · 1 comment

Comments

@IndrajeetPatil
Copy link

The zeallot package provides multiple assignment operator %<-%, but {AlignAssign} detects it as assignment operator.

AlignAssign:::guess_operator("%<-%")
#> [1] "<-"

Created on 2021-11-11 by the reprex package (v2.0.1)

This leads to AlignAssign incorrectly formatting code of the following form

if (type == "parametric") c(.ns, .fn) %<-% c("metafor", "rma")
if (type == "robust") c(.ns, .fn) %<-% c("metaplus", "metaplus")
if (type == "bayes") c(.ns, .fn) %<-% c("metaBMA", "meta_random")

to

if (type == "parametric") c(.ns, .fn) %<-% c("metafor", "rma")
if (type == "robust") c(.ns, .fn) %    <-% c("metaplus", "metaplus")
if (type == "bayes") c(.ns, .fn) %     <-% c("metaBMA", "meta_random")

A way around this is either to make guess_operator() smart enough to detect multiple assignment operator, or to just add support for the multiple assignment operator.

@seasmith
Copy link
Owner

It should be a matter of logic in ‘guess_operator()’ and then writing an ‘alignAssignZeallot()’ function for the addin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants