Hello,
As a follow up on this thread, I've now commited a lazy version of
sapply. It can be used with a functor that has a nested result_type
type, or raw functions as illustrated by these examples from the unit
tests:
test.sugar.sapply <- function( ){
inc <- '
template
By the way, you were correct in your original response that all I
really need is input_transform but it is certainly a worthwhile
exercise to see how traits, etc. are used and I appreciate your kind
explanations.
On Wed, Jun 16, 2010 at 10:58 AM, Romain Francois
wrote:
> Le 16/06/10 17:44, Dougla
Le 16/06/10 17:44, Douglas Bates a écrit :
Thank you very much, Romain. This certainly helps my understanding of
unary_function, traits, etc. These are the sorts of things I can read
about but until I see a non-trivial usage it is hard to keep these
ideas straight.
Two minor questions occur t
Thank you very much, Romain. This certainly helps my understanding of
unary_function, traits, etc. These are the sorts of things I can read
about but until I see a non-trivial usage it is hard to keep these
ideas straight.
Two minor questions occur to me at this point. In my code I assigned
the
Small update incorporating the use of all (and using namespace Rcpp to
make things slightly less cluterred).
require( Rcpp )
require( inline )
inc <- '
using namespace Rcpp ;
template
Vector< traits::r_sexptype_traits< typename FUN::result_type>::rtype >
sapply(const OBJECT& object, FUN fu
Le 16/06/10 14:58, Douglas Bates a écrit :
Ever since I read Phil Spector's book on S I have been a fan of
functional programming in S and R. When Jose Pinheiro and I were
working on the nlme package there was a joke between us that you could
tell which of us wrote which parts of the code beca
Ever since I read Phil Spector's book on S I have been a fan of
functional programming in S and R. When Jose Pinheiro and I were
working on the nlme package there was a joke between us that you could
tell which of us wrote which parts of the code because his parts
always had an object named "aux"