Skip to content

Instantly share code, notes, and snippets.

@cdiener
Last active July 7, 2022 19:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdiener/549628c865b5244a7b7a to your computer and use it in GitHub Desktop.
Save cdiener/549628c865b5244a7b7a to your computer and use it in GitHub Desktop.
R operator overloading
a = "bla"
b = "so on"
class(a) = append("my_class", class(a))
'+.my_class' = function(x,y) paste(x,y,sep=" and ")
print(a+b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment