[R-pkg-devel] Overriding + operator in a package

Emanuele Cordano em@nue|e@cord@no @end|ng |rom gm@||@com
Sat Mar 21 20:03:07 CET 2020


Dear list,

I just released on my Github account the following R package:
https://github.com/ecor/stringplus
containing an override of '+' arithmetic operator in order to sum two
strings as follows:

```

library(stringplus)

subject <- "Susan"
     verb <- "is eating"
     object <- "an apple"

     out <- subject+" "+verb+" "+object

     dir <- "~/mydrir/"
     files <- c("myfile.txt","readme.txt")


```
I would like to submit "stringplus"  to CRAN but while ckecking I found out
the following warning:

* checking S3 generic/method consistency ... WARNING
Warning: declared S3 method '+.character' not found
Warning: declared S3 method '+.default' not found
See section ‘Generic functions and methods’ in the ‘Writing R
Extensions’ manual.

R version 3.6.3 (2020-02-29) -- "Holding the Windsock"

I wrote the method in S3. I checked the section ‘Generic functions and
methods’ in the ‘Writing R' (R-release) Extensions’ manual but I did not
find a clear (to me) example or explanation  for arithmetic (or base)
operators.
Do you suggest how to solve this warning?

Thank you
I hope you are all well.
Best regards
Emanuele Cordano

-- 
Emanuele Cordano, PhD
Environmental Engineer / Ingegnere per l' Ambiente e il territorio nr.
3587 (Albo A - Provincia di Trento)
cell: +39 3282818564
email: emanuele.cordano using gmail.com,emanuele.cordano using rendena100.eu,
emanuele.cordano using eurac.edu
PEC: emanuele.cordano using ingpec.eu
URL: www.rendena100.eu
LinkedIn: https://www.linkedin.com/in/emanuele-cordano-31995333
GitHub: https://github.com/ecor

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list