Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/t-kalinowski/commafree
https://github.com/t-kalinowski/commafree
Last synced: 9 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/t-kalinowski/commafree
- Owner: t-kalinowski
- License: gpl-3.0
- Created: 2022-10-23T14:44:19.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-19T13:52:39.000Z (7 months ago)
- Last Synced: 2024-10-12T04:47:39.949Z (25 days ago)
- Language: R
- Size: 15.6 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# commafree
{commafree} is an R package that provides the "comma-free call" operator:
`%(%`. Use it to call a function with arguments, but without commas
separating the arguments. Just replace the `(` with `%(%` in a function
call, supply your arguments as standard R expressions enclosed by `{ }` and
be free of commas (for that call).It is especially useful for long multi-line function calls with many
arguments, like a shiny UI definition, an R6 class definition, or
similar.`%(%` merely does a syntax transformation, so that a call like this:
``` r
func %(% {
a
b
c
}
```is equivalent to writing this:
``` r
func(
a,
b,
c
)
```## Installation
You can install {commafree} like so:
``` r
install.packages("commafree")
## Install the dev version:
# remotes::install_github("t-kalinowski/commafree")
```## Example
``` r
library(commafree)writeLines(c %(% {
"I write, erase, rewrite"
"Erase again, and then"
"A poppy blooms."
})
```I write, erase, rewrite
Erase again, and then
A poppy blooms.Haiku by Katsushika Hokusai