Hi Him.

Did you read the Help/Manual in PDF/A Instroduction to R.PDF?


MyVect<-scan()
0 0 0 0 1
1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 0

MyVect
MyMat<-matrix(MyVect, ncol=5, byrow=T)
MyMat

bests
milton



On Fri, Dec 11, 2009 at 10:47 AM, Moohwan Kim <kmhlmj2@gmail.com> wrote:

> Dear R family
>
>  I am attempting to create a matrix. e.g.,
>  0 0 0 0 1
>  1 0 0 0 0
>  0 1 0 0 0
>  0 0 1 0 0
>  0 0 0 1 0
>  How could I write a R program?
>  Later I want to extend it to a N by N case.
>  Thanks in advance
>
>  best
>  Moohwan
>
> ______________________________________________
> 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<http://www.r-project.org/posting-guide.html>
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]


