{"id":14068229,"url":"https://github.com/moodymudskipper/inops","last_synced_at":"2025-04-12T20:52:12.513Z","repository":{"id":56936670,"uuid":"197967361","full_name":"moodymudskipper/inops","owner":"moodymudskipper","description":"Infix Operators for Detection, Subsetting and Replacement","archived":false,"fork":false,"pushed_at":"2019-11-19T13:56:55.000Z","size":191,"stargazers_count":40,"open_issues_count":6,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-12T20:52:07.015Z","etag":null,"topics":["r","r-language","r-package","r-programming","r-stats"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moodymudskipper.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-20T18:25:01.000Z","updated_at":"2024-02-29T23:22:27.000Z","dependencies_parsed_at":"2022-08-21T07:20:45.522Z","dependency_job_id":null,"html_url":"https://github.com/moodymudskipper/inops","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moodymudskipper%2Finops","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moodymudskipper%2Finops/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moodymudskipper%2Finops/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moodymudskipper%2Finops/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moodymudskipper","download_url":"https://codeload.github.com/moodymudskipper/inops/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631728,"owners_count":21136560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["r","r-language","r-package","r-programming","r-stats"],"created_at":"2024-08-13T07:06:02.323Z","updated_at":"2025-04-12T20:52:12.481Z","avatar_url":"https://github.com/moodymudskipper.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n\noptions(width=110)\n```\n\n# inops\n\nPackage implementing additional infix operators for R.\n\nImplemented operators work with 4 different value types: **sets**, **intervals**, **regular expressions**, and **counts**.\\\nAnd provide 3 distinct functionalities: **detection**, **subsetting**, and **replacement**.\n\n![inops_operator_table](http://karolis.koncevicius.lt/data/inops/inops_operator_table.png)\n\nFor more examples please see the vignette.\\\nFor a complete list of available operators consult the tables below.\n\n## Syntax ##\n\nAll operators have the same form composed of two distinct parts: `%\u003coperation\u003e\u003ctype\u003e%`.\n\n* `[operation]` specifies the performed functionality and can be one of `in`, `out`, `[in`, `[out`.\n* `[type]` specifies the type of operation and can be one of `{}`, `[]`, `()`, `[)`, `(]`, `~`, `~p`, `~f`, `#`.\n\n### Detection Operators ###\n\n|  Form       |                             Description                                  |            Call               |\n|-------------|--------------------------------------------------------------------------|-------------------------------|\n| `%in{}%`    | which elements are inside a set                                          | `x %in{}% set`                |\n| `%in[]%`    | which elements are inside a closed interval                              | `x %in[]% interval`           |\n| `%in()%`    | which elements are inside an open interval                               | `x %in()% interval`           |\n| `%in[)%`    | which elements are inside an interval open on the right                  | `x %in[)% interval`           |\n| `%in(]%`    | which elements are inside an interval open on the left                   | `x %in(]% interval`           |\n| `%in~%`     | which elements match a regular expression                                | `x %in~% pattern`             |\n| `%in~p%`    | which elements match a regular perl expression                           | `x %in~p% pattern`            |\n| `%in~f%`    | which elements match a regular fixed expression                          | `x %in~f% pattern`            |\n| `%in#%`     | which elements occur a specified number of times                         | `x %in#% count`               |\n| `%out%`     | which elements are outside a set (same as ! x %in% y)                    | `x %out% set`                 |\n| `%out{}%`   | which elements are outside a set                                         | `x %out{}% set`               |\n| `%out[]%`   | which elements are outside a closed interval                             | `x %out[]% interval`          |\n| `%out()%`   | which elements are outside an open interval                              | `x %out()% interval`          |\n| `%out[)%`   | which elements are outside an interval open on the right                 | `x %out[)% interval`          |\n| `%out(]%`   | which elements are outside an interval open on the left                  | `x %out(]% interval`          |\n| `%out~%`    | which elements do not match a regular expression                         | `x %out~% pattern`            |\n| `%out~p%`   | which elements do not match a regular perl expression                    | `x %out~p% pattern`           |\n| `%out~f%`   | which elements do not match a regular fixed expression                   | `x %out~f% pattern`           |\n| `%out#%`    | which elements occur other than a specified number of times              | `x %out#% count`              |\n\n### Subsetting Operators ###\n\n|  Form       |                             Description                                  |            Call               |\n|-------------|--------------------------------------------------------------------------|-------------------------------|\n| `%[==%`     | select elements equal to the provided value                              | `x %[==% element`             |\n| `%[!=%`     | select elements not equal to the provided value                          | `x %[!=% element`             |\n| `%[\u003e%`      | select elements greater than the provided value                          | `x %[\u003e% number`               |\n| `%[\u003c%`      | select elements lower than the provided value                            | `x %[\u003c% number`               |\n| `%[\u003e=%`     | select elements greater or equal to the provided value                   | `x %[\u003e=% number`              |\n| `%[\u003c=%`     | select elements lower or equal to the provided value                     | `x %[\u003c=% number`              |\n| `%[in%`     | select elements inside a set                                             | `x %[in% set`                 |\n| `%[in{}%`   | select elements inside a set                                             | `x %[in{}% set`               |\n| `%[in[]%`   | select elements inside a closed interval                                 | `x %[in[]% interval`          |\n| `%[in()%`   | select elements inside an open interval                                  | `x %[in()% interval`          |\n| `%[in[)%`   | select elements inside an interval open on the right                     | `x %[in[)% interval`          |\n| `%[in(]%`   | select elements inside an interval open on the left                      | `x %[in(]% interval`          |\n| `%[in~%`    | select elements matching a regular expression                            | `x %[in~% pattern`            |\n| `%[in~p%`   | select elements matching a regular perl expression                       | `x %[in~p% pattern`           |\n| `%[in~f%`   | select elements matching a regular fixed expression                      | `x %[in~f% pattern`           |\n| `%[in#%`    | select elements that occur a specified number of times                   | `x %[in#% count`              |\n| `%[out%`    | select elements outside a set                                            | `x %[out%  set`               |\n| `%[out{}%`  | select elements outside a set                                            | `x %[out{}%  set`             |\n| `%[out[]%`  | select elements outside a closed interval                                | `x %[out[]% interval`         |\n| `%[out()%`  | select elements outside an open interval                                 | `x %[out()% interval`         |\n| `%[out[)%`  | select elements outside an interval open on the right                    | `x %[out[)% interval`         |\n| `%[out(]%`  | select elements outside an interval open on the left                     | `x %[out(]% interval`         |\n| `%[out~%`   | select elements not matching a regular expression                        | `x %[out~% pattern`           |\n| `%[out~p%`  | select elements not matching a regular perl expression                   | `x %[out~p% pattern`          |\n| `%[out~f%`  | select elements not matching a regular fixed expression                  | `x %[out~f% pattern`          |\n| `%[out#%`   | select elements that occur other than specified number of times          | `x %[out% count`              |\n\n### Replacement Operators ###\n\n|  Form       |                             Description                                  |            Call               |\n|-------------|--------------------------------------------------------------------------|-------------------------------|\n| `==\u003c-`      | change elements equal to the provided value                              | `x == element \u003c- value`       |\n| `!=\u003c-`      | change elements not equal to the provided value                          | `x != element \u003c- value`       |\n| `\u003e\u003c-`       | change elements greater than the provided value                          | `x \u003e number \u003c- value`         |\n| `\u003c\u003c-`       | change elements lower than the provided value                            | `x \u003c number \u003c- value`         |\n| `\u003e=\u003c-`      | change elements greater or equal to the provided value                   | `x \u003e= number \u003c- value`        |\n| `\u003c=\u003c-`      | change elements lower or equal to the provided value                     | `x \u003c= number \u003c- value`        |\n| `%in%\u003c-`    | change elements inside a set                                             | `x %in% set \u003c- value`         |\n| `%in{}%\u003c-`  | change elements inside a set                                             | `x %in{}% set \u003c- value`       |\n| `%in[]%\u003c-`  | change elements inside a closed interval                                 | `x %in[]% interval \u003c- value`  |\n| `%in()%\u003c-`  | change elements inside an open interval                                  | `x %in()% interval \u003c- value`  |\n| `%in[)%\u003c-`  | change elements inside an interval open on the right                     | `x %in[)% interval \u003c- value`  |\n| `%in(]%\u003c-`  | change elements inside an interval open on the left                      | `x %in(]% interval \u003c- value`  |\n| `%in~%\u003c-`   | change elements matching a regular expression                            | `x %in~% pattern \u003c- value`    |\n| `%in~p%\u003c-`  | change elements matching a regular perl expression                       | `x %in~p% pattern \u003c- value`   |\n| `%in~f%\u003c-`  | change elements matching a regular fixed expression                      | `x %in~f% pattern \u003c- value`   |\n| `%in#%\u003c-`   | change elements that occur specified number of times                     | `x %in#% count \u003c- value`      |\n| `%out%\u003c-`   | change elements outside a set                                            | `x %out% set \u003c- value`        |\n| `%out{}%\u003c-` | change elements outside a set                                            | `x %out{}% set \u003c- value`      |\n| `%out[]%\u003c-` | change elements outside a closed interval                                | `x %out[]% interval \u003c- value` |\n| `%out()%\u003c-` | change elements outside an open interval                                 | `x %out()% interval \u003c- value` |\n| `%out[)%\u003c-` | change elements outside an interval open on the right                    | `x %out[)% interval \u003c- value` |\n| `%out(]%\u003c-` | change elements outside an interval open on the left                     | `x %out(]% interval \u003c- value` |\n| `%out~%\u003c-`  | change elements not matching a regular expression                        | `x %out~% pattern \u003c- value`   |\n| `%out~p%\u003c-` | change elements not matching a regular perl expression                   | `x %out~p% pattern \u003c- value`  |\n| `%out~f%\u003c-` | change elements not matching a regular fixed expression                  | `x %out~f% pattern \u003c- value`  |\n| `%out#%\u003c-`  | change elements that occur other than specified number of times          | `x %out#% count \u003c- value`     |\n\n## Notes ##\n\n1. **Overloading**\n\nTo give an assignment counterpart to `\u003c` we had to overload the `\u003c\u003c-` operator, which explains the message when attaching the package.\nThis doesn't affect the behavior of the `\u003c\u003c-` assignments.\n\n2. **Behaviour**\n\nDetection operators should be seen as an extension of the standard infix operators implemented in R (i.e. `==`, `\u003e`, etc).\nFor this reason the implemented operators differ from standard `%in%` and behave more like `==` on `data.frames` and objects with `NA` values.\n\nSubsetting and replacement operators are wrappers around detection operators.\\\nSubsetting: `x[ x %in{}% set]`.\\\nReplacement: `replace(x, x %in{}% set, value)`.\n\n## See Also ##\n\nOther similar packages you might be interested in.\n\n1. [intrval](https://github.com/psolymos/intrval)\n2. [operators](https://github.com/romainfrancois/operators)\n3. [infix](https://github.com/ebeneditos/infix)\n4. [invctr](https://github.com/FredHasselman/invctr)\n5. [grapes](https://github.com/wlandau/grapes)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoodymudskipper%2Finops","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoodymudskipper%2Finops","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoodymudskipper%2Finops/lists"}