Re: [R] Chaining multiple replacement functions in R

2014-12-30 Thread Daniel Gabrieli
This is what I came up with (to make the recursive function return the position of the 'name' and still be able to chain the calls together). I am not sure if this is a great way to do it... but it seems to be working... rmatch.pos <- function(object, name, seq=NA, level=NULL){ ##return the vec

Re: [R] Chaining multiple replacement functions in R

2014-12-30 Thread Daniel Gabrieli
That is really helpful. I am trying to get the rmatch function to return the position of the 'name' instead of the value. So rmatch(app, "FirsKey") would return c(3,3,1). Then app[[c(3,3,1)]] <- 'new value' would be perfect. On Tue, Dec 30, 2014 at 6:43 AM, Duncan Murdoch wrote: > On 29/12/

Re: [R] Chaining multiple replacement functions in R

2014-12-30 Thread Duncan Murdoch
On 29/12/2014 4:41 PM, Daniel Gabrieli wrote: > I cross posted this on Stack Overflow: > http://stackoverflow.com/questions/27694466/chaining-multiple-replacement-functions-in-r > > > I am using R to work with a large JS object (using the library rjsonio). As > such, I have a lot of nested lists,