Liaw, Andy wrote: > [material omitted...] > >I guess this can only work if "-" is treated specially in the subset >operators, so that, e.g., x[-"Andy"] would also work. (This would be nice, >IMHO.) > I agree that x[-c("Andy", "Pat")] would come in handy at times, but x[-numeric(0)] still can not work because the numbers that aren't there might be negative and the minus sign is to put them positive.
Pat
Maybe what's needed is a new simple class that wraps vectors that can be used as indices, e.g.,
> x[subomit(c("Andy", "Pat"))] # returns all elements except those named
> x[subomit(c(1,4,9))]
> x[subomit(numeric(0))] # returns all elementsThis would require appropriate modifications to the code for "[" to detect when its indices were of class "subomit".
-- Tony Plate
______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
