[Rd] The case for a pipe assignment operator + database of R code

David Hugh-Jones d@v|dhughjone@ @end|ng |rom gm@||@com
Fri Dec 29 16:30:52 CET 2023


Hi all,

I wrote up the case for having a pipe assignment operator in R here:
https://hughjonesd.github.io/case-for-pipe-assignment.html

A pipe assignment operator would expand e.g.

obj <|> do_something()

to

obj <- obj |> do_something()

and therefore to

obj <- do_something(obj)

Just for fun, I made a patch to the R source at
https://hughjonesd.github.io/pipe-assignment.patch. It is highly imperfect,
and made against github rather than svn, so it is just a proof of concept.

Maybe more interesting to list readers is the dataset of R code I created
to learn how people use assignments in real world code. It has about 26000
code snippets, from github, Stackoverflow questions, and R package
examples. It might be useful if you are researching real world usage
patterns in R. I didn't know of any existing resources:

https://github.com/hughjonesd/codesamples

Happy new year!

David

	[[alternative HTML version deleted]]



More information about the R-devel mailing list