search for: create_accessors

Displaying 1 result from an estimated 1 matches for "create_accessors".

2007 Feb 23
2
Functions that write functions in R packages
...me so they are including in the package rdata file * dynamically create at package load time Can anyone offer any advice as to which is preferable? (or if there's a better way I haven't thought of) My code currently looks like this (experimenting with two ways of creating the functions) create_accessors <- function(objects, name, short=NULL) { lapply(objects, function(x) { assign(paste(name, x$objname, sep="_"), x$new, pos=globalenv()) if (!is.null(short)) { eval( substitute( f <- function(plot, ...) plot + add(...), list( add = as.name(paste(name, x$obj...