It's true one may have to set some rules but I think you are blowing it up.
First, it is true one would have to agree for list[[vec]] to always return a matrix but it is the useful behaviour since you can already get a vector with unlist(list[vec]). Second, as to the raggedness, matrix(), array() and probably other methods already have rules to deal with it, i.e., they cycle and post a warning if the desired length is not a multiple of the length of the supplied "prototype". You'd get a matrix of the length of the longest selected list element; anything else would be baroque. Third, as to heterogeneity, matrix() and as.matrix() already face the same issue and so have a set of coercion rules to deal with it; when they can't they throw an error. Lastly, you are correct that I had overlooked the problem of nested lists and that one need (at least I think so) to make some non-obvious rules to decided how to flatten them. So you'd throw an error in that case. In short I think array [[]] indexing would still be well-defined for data frames and non-nested lists, with no need for new and special rules. Given the existence of alternatives it might or might not be very useful but it would remove the shock factor of an indexing operator that does not take vector arguments. Regards, -- O.L. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.