> Da: Linlin Yan [mailto:yanlinli...@gmail.com] > Inviato: venerdì 11 settembre 2009 11.19 > A: Luca Braglia > Cc: r-help@r-project.org > 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 ______________________________________________ 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.