> Da: Linlin Yan [mailto:[email protected]] > Inviato: venerdì 11 settembre 2009 11.19 > A: Luca Braglia > Cc: [email protected] > Oggetto: Re: [R] how to do this? > > Try this: > > y[matrix(c(seq_along(x), x), ncol = 2)] > [1] 2 16 12
Very interesting! So I can give as index to a data.frame a matrix (of index) too (not only vectors separated by commas). Thank you ______________________________________________ [email protected] 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.

