I have defined the following in R:
plotWaterfall <- function(x, ...) UseMethod("plotWaterfall")
plotWaterfall.default <- function(x, ...) {print("Default method does nothing")}
plotWaterfall.vector <- function(x, ...) {print("Vector method does something")}
Now if I test the following example:
x<-c(1,2,3)
plotWaterfall(x)
it will print "Default method does nothing" indicating that the S3 framework matches the default method instead of the vector method. Now why is that?