[R] inserting row(column) in array or dataframe at specified row(column)
tom at maladmin.com
Sun May 1 20:59:45 CEST 2016
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 <jan.kacaba at gmail.com> 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 and ease of use. The functions are of following format:
> appcol=function(original_array, inserted_object, column_number,
> # If overwrite=TRUE the columns after column_number are ovewritten by
> inserted_object else the columns after column_number are shifted.
> Now I have started using package dplyr and it seams that there is no
> inserting function either. One can only append at the end or at the
> beginning of tbl_df. Is it true?
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
[[alternative HTML version deleted]]
More information about the R-help