On Wed, 25 Jun 2014 14:16:08 -0700 (PDT)
Jeff Newmiller <jdnew...@dcn.davis.ca.us> wrote:

> The brokenness of your perm.broken function arises from the attempted
> use of sapply to bind matrices together, which is not something
> sapply does.
> 
> perm.fixed <- function( x ) {
>    if ( length( x ) == 1 ) return( matrix( x, nrow=1 ) )
>    lst <- lapply( seq_along( x )
>                 , function( i ) {
>                     cbind( x[ i ], perm.jdn( x[ -i ] ) )
>                   }
>                 )
>    do.call(rbind, lst)
> }

Nice, exactly what I was looking for (including typo). Thanks!

robert

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to