[R] Trying to build up functions with its names by means of lapply

Julio Sergio juliosergio at gmail.com
Wed Jun 5 16:39:10 CEST 2013


Rui Barradas <ruipbarradas <at> sapo.pt> writes:

> My solution works but it is incorrect. We should force the argument 'c', 
> 
> faux <- function(c) {
> 	force(c)
> 	function (x) get(paste0(c,"gamma"))(x,k,scale=theta)
> }

Thanks a lot, Rul. I think I have to learn a bit more about lazy evaluation 
of arguments, as someone else told me at the beginning of this discussion.


  -Sergio.



More information about the R-help mailing list