Just to get something reproducible lets assume the objects of class "myobj" each consists of a one-element list that contains a data frame. Then try this:
# constructor myobj <- function(...) structure(list(value = data.frame(...)), class = "myobj") "$.myobj" <- function(obj, x) .subset2(obj, 1)[[x]] "[[.myobj" <- function(obj, ...) .subset2(obj, 1)[[...]] "[.myobj" <- function(obj, ...) .subset2(obj, 1)[...] # test x <- myobj(x = 1:3, y = 4:6) class(x) x[[1]] x[1,] x$y On 3/7/06, hadley wickham <[EMAIL PROTECTED]> wrote: > > If your class is a subclass of data.frame then I think > > it ought to be a special sort of data frame so all you > > need to do is the following in which case you get subscripting > > for free by inheritance: > > My class is actually an external pointer to a data set stored in > ggobi, so I don't think this will work. as.data.frame.ggobiDataset > retrieves the whole dataset out of ggobi and in to R. > > Hadley > ______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html