On Fri, Apr 17, 2009 at 8:38 AM, David Hajage wrote:
> Hello R useRs,
>
> I have a function which returns a list of functions :
>
> freq1 <- function(x) {
> lev <- unique(x[!is.na(x)])
> nlev <- length(lev)
> args <- alist(x=)
>
> if (nlev == 1) {
> body <- c("{", "sum(!is.na(x))", "}")
>
Hello R useRs,
I have a function which returns a list of functions :
freq1 <- function(x) {
lev <- unique(x[!is.na(x)])
nlev <- length(lev)
args <- alist(x=)
if (nlev == 1) {
body <- c("{", "sum(!is.na(x))", "}")
f <- function() {}
formals(f) <- as.pairlist(args)
body(f)
2 matches
Mail list logo