Re: [R] How to insert a vector or matrix into an existing matrix

From: Gabor Csardi <csardi_at_rmki.kfki.hu>
Date: Sun, 20 Apr 2008 15:39:35 +0200

Hmm, my understanding is different,

m <- matrix(sample(10*10), ncol=10)
m2 <- rbind( m[1:5,], 1:10, m[6:10,] )
m3 <- cbind( m[,1:8], 1:10, m[,9:10] )

G.

On Sun, Apr 20, 2008 at 10:21:47AM -0300, Henrique Dallazuanna wrote:
> If I understand:
>
> m <- matrix(sample(10*10), ncol=10)
> m[5:6, 8:9] <- 1:4
>
>
>
> On 4/18/08, Ng Stanley <stanleyngkl_at_gmail.com> wrote:
> > Hi,
> >
> > Is there any functions to insert a vector or matrix into an existing matrix
> > say between row 5 and 6 or column 8 and 9, without creating a temporary
> > matrix ?
> >
> > Thanks
> > Stanley
> >
> > [[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.

-- 
Csardi Gabor <csardi_at_rmki.kfki.hu>    UNIL DGM

______________________________________________
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 Sun 20 Apr 2008 - 14:04:03 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 Sun 20 Apr 2008 - 20:30:56 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