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

how to run R operator "%%", "%/", "%in%" #103

Closed
behrica opened this issue May 11, 2024 · 5 comments
Closed

how to run R operator "%%", "%/", "%in%" #103

behrica opened this issue May 11, 2024 · 5 comments

Comments

@behrica
Copy link
Member

behrica commented May 11, 2024

could not find them defined in code.

@genmeblog
Copy link
Member

It was here: 953338e

However later it was removed. Since it was used in symbolic DSL you just can use it as a string, ie (r '("%/%" ...))

@genmeblog
Copy link
Member

And explicit definition of the operators wrapped in % were removed in beta12 to treat the globally as binary operators: https://github.com/scicloj/clojisr/blob/master/CHANGELOG.md?plain=1#L71

@behrica
Copy link
Member Author

behrica commented May 12, 2024

so should we add clojure functions for it ?

we have "rdiv" and other arithmetic functions as well:
https://github.com/behrica/clojuress/blob/5a711b485a41199535b913ebca80febb8b297ae9/src/clojisr/v1/r.clj#L209

The help of R puts them as well as the "same thing":

Description:

     These unary and binary operators perform arithmetic on numeric or
     complex vectors (or objects which can be coerced to them).

Usage:

     + x
     - x
     x + y
     x - y
     x * y
     x / y
     x ^ y
     x %% y
     x %/% y

@genmeblog
Copy link
Member

%/% is invalid clojure symbol, so %div% should be a replacement.

@behrica
Copy link
Member Author

behrica commented May 12, 2024

%/% is invalid clojure symbol, so %div% should be a replacement.

Ok, I check for missing operators and will add them in PR #99

@behrica behrica closed this as completed May 12, 2024
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