Skip to content
Prev 2457 / 63424 Next

cbind is not generic as claimed, omits labels where S has them (PR#239)

ripley@stats.ox.ac.uk writes:
Hmm. 

(1) The docs are clearly wrong (or perhaps rather, wishful thinking)

(2) Cbind should be generic as in Splus

(3) For the labels, one needs essentially to implement deparse.level
    or face the horrors of
    eval(substitute(cbind(a,b,deparse.level=2),list(a=rnorm(10),b=rnorm(10))))

(4) The dataframe special casing seems to be an evasion. The sticky
    bit is that one needs to dispatch on *any* argument. For Splus (3.4)
    compatibility, one has to check each argument for its class
    method, and if all arguments agree - in the sense that all the
    arguments that have class methods must have the same one, dispatch
    to that method. If they disagree, print error message and try
    default method. 

    Whoever wrote the code seems to have decided that things would be
    easier if one assumed that the only method for cbind was
    cbind.data.frame...

    Note that by the above logic, if you make a cbind.ts, you can't
    cbind a time series to a data frame!