Thank you Phil and Bert! I was sure there must be an efficient way using some kind of indexing trick but totally did not see the as.matrix solution.
Thanks again Philipp On Wed, Nov 05, 2008 at 02:59:20PM -0800, Phil Spector wrote: > Philipp - > > res = matrix(NA,5,3) > res[as.matrix(foo[,c(1,2)])] = foo$val > -- Dr. Philipp Pagel Lehrstuhl für Genomorientierte Bioinformatik Technische Universität München Wissenschaftszentrum Weihenstephan 85350 Freising, Germany http://mips.gsf.de/staff/pagel ______________________________________________ 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.