### How we would make the function with() into a generic:
## Since the second argument, 'expr' is used literally, we want
## with() to only have "data" in the signature.
## Not run: ------------------------------------
# setGeneric("with", signature = "data")
# ## Now we could predefine methods for "with" if we wanted to.
#
# ## When ready, we store the generic as implicit, and restore the
# original
#
# setGenericImplicit("with")
## ---------------------------------------------
implicitGeneric("with")
# (This implicit generic is stored in the 'methods' package.)
Run the code above in your browser using DataCamp Workspace