Re: [R] create a matrix with values from data.frame

From: Nicolas Gutierrez <nicolasg_at_uw.edu>
Date: Sat, 19 Mar 2011 15:16:58 -0700

Thanks Jim and David.. that was easy!

Nic

On 3/19/2011 3:00 PM, jim holtman wrote:

> x.mat<- matrix(NA, 95, 55)  # create matrix

>> x.mat[cbind(x$xloc, x$yloc)]<- x$totW
>> which(!is.na(x.mat), arr.ind =TRUE)


R-help_at_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. Received on Sat 19 Mar 2011 - 22:23:04 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 19 Mar 2011 - 23:40:22 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive