Re: [R] inserting row(column) in array or dataframe at specified row(column)

2016-05-02 Thread PIKAL Petr
Hi You can use rbind, cbind but you need to be aware of what objects you are binding together. mm<-matrix(rnorm(12), 3,4) > rbind(mm[1:2,], 1:4, mm[3,]) [,1] [,2] [,3] [,4] [1,] -0.2029407 -1.5910628 -0.2582281 -0.1649921 [2,] -0.6913951 0.3591561 0.8236836 -0.3592

Re: [R] inserting row(column) in array or dataframe at specified row(column)

2016-05-01 Thread David Winsemius
> On May 1, 2016, at 10:53 AM, Jan Kacaba wrote: > > Hello dear R users, > > Is there a function or package which can insert row, column or array in > another array at specified place (row or column)? > > I have made several attempts at this function optimizing both speed, code > readability a

Re: [R] inserting row(column) in array or dataframe at specified row(column)

2016-05-01 Thread Tom Wright
If you can address your columns by name then order shouldn't matter. If the column order does matter, perhaps a matrix is a better structure to use? On Sun, May 1, 2016, 10:56 AM Jan Kacaba wrote: > Hello dear R users, > > Is there a function or package which can insert row, column or array in >