[R] inserting row(column) in array or dataframe at specified row(column)
David Winsemius
dwinsemius at comcast.net
Sun May 1 22:02:01 CEST 2016
> On May 1, 2016, at 10:53 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,
> overwrite=FALSE)
This does not offer code, only the list of formals. If you want help with coding, then you should provide some. I remember a posting by Gabor Grothendieck on StackOverflow (where he cited another blogger) where he demonstrated how to implement a postfix "+" function like that of C, that I _think_ might address this question but without a MWE and desired result I cannot do any testing.
>
> 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?
Probably not. There's always:
> fortunes::fortune("Yoda")
Evelyn Hall: I would like to know how (if) I can extract some of the
information from the summary of my nlme.
Simon Blomberg: This is R. There is no if. Only how.
-- Evelyn Hall and Simon 'Yoda' Blomberg
R-help (April 2005)
> [[alternative HTML version deleted]]
One of _your_ tasks is now to learn "how" to tell gmail to post in plaintext.
--
David Winsemius
Alameda, CA, USA
More information about the R-help
mailing list