Re: [R] help on establishing a matrix

From: Henrique Dallazuanna <wwwhsd_at_gmail.com>
Date: Wed, 30 Jan 2008 16:17:40 -0200

Perhaps like this:

 diag(mat[data$row, data$column]) <- data$height

On 29/01/2008, Gator Connection <gatorconnection_at_hotmail.com> wrote:
>
> I am a beginner and this is a naive question.
> I have the following data set.
> row column height
> 1 2 96
> 3 7 67
> 9 25 77
> ......
> I have a matrix of 50*100 data points and about 60% of them are zeros.
> I want to put the height data into the matrix according to their row and column numbers. does anybody have experience in setting up such matrix?
> Your help is highly appreciated.
> Jack
> LSU
> _________________________________________________________________
> [[elided Hotmail spam]]
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
>

-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

______________________________________________
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 Wed 30 Jan 2008 - 18:21:26 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 Wed 30 Jan 2008 - 18:30:09 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