Skip to content
Prev 298832 / 398503 Next

Constructing a list using a function...

Hello,

Try

myfun2 <- function(DF, FUN){
	x <- lapply(as.data.frame(t(DF[-1])), function(x) FUN(x[1], x[2]))
	names(x) <- levels(DF[[1]])[ DF[[1]] ]
	x
}

myfun2(myframe, myfun)

Hope this helps,

Rui Barradas

Em 02-07-2012 07:02, Onur Uncu escreveu: