search for: make_my_list

Displaying 2 results from an estimated 2 matches for "make_my_list".

2015 May 04
2
Define replacement functions
Hello I tried to define replacement functions for the class "mylist". When I test them in an active R session, they work -- however, when I put them into a package, they don't. Why and how to fix? make_my_list <- function( x, y ) { return(structure(list(x, y, class="mylist"))) } mylist <- make_my_list(1:4, letters[3:7]) mylist mylist[['x']] <- 4:6 mylist "[[<-" <- function(x, field, value) { UseMethod('[[<-', x) } "[[<-.mylist" <- fu...
2015 May 04
1
Define replacement functions
...n.vogel at posteo.ch> wrote: >> Hello >> >> I tried to define replacement functions for the class "mylist". When I test them in an active R session, they work -- however, when I put them into a package, they don't. Why and how to fix? >> >> >> make_my_list <- function( x, y ) { >> return(structure(list(x, y, class="mylist"))) >> } >> mylist <- make_my_list(1:4, letters[3:7]) >> mylist >> mylist[['x']] <- 4:6 >> mylist >> "[[<-" <- function(x, field, value) { &...