From gr@ntmcd @end|ng |rom uoregon@edu  Sat Dec  4 23:36:44 2021
From: gr@ntmcd @end|ng |rom uoregon@edu (Grant McDermott)
Date: Sat, 4 Dec 2021 22:36:44 +0000
Subject: [Rd] string concatenation operator (revisited)
Message-ID: <MWHPR1001MB2384CD0939331AF4B4DE9C41CF6B9@MWHPR1001MB2384.namprd10.prod.outlook.com>

Hi all,

I wonder if the R Core team might reconsider an old feature request, as detailed in this 2005 thread: https://stat.ethz.ch/pipermail/r-help/2005-February/thread.html#66698

The TL;DR version is base R support for a `+.character` method. This would essentially provide a shortcut to `paste?0`, in much the same way that `\(x)` now provides a shortcut to `function(x)`.

> a = "hello "; b = "world"
> a + b
> [1] "hello world"

I appreciate some of the original concerns raised against a native "string1 + string2" implementation. The above thread also provides several use-at-your-own-risk workarounds. But sixteen years is a long time in software development and R now stands as something of an exception on this score. Python, Julia, Stata, and SQL (among various others) all support native string concatenation/interpolation using binary/arithmetic operators. It's been a surprising source of frustration for students in some of the classes I teach, particularly those coming from another language.

Many thanks for considering.

PS. I hope I didn't miss any additional discussion of this issue beyond the original 2005 thread. My search efforts didn't turn anything else up, except this popular Stackoverflow question: https://stackoverflow.com/questions/4730551/making-a-string-concatenation-operator-in-r

Grant McDermott
Assistant Professor
Department of Economics
University of Oregon
www.grantmcdermott.com


	[[alternative HTML version deleted]]



[Rd] string concatenation operator (revisited)
Grant McDermott