[R] force apply not to drop the dimensions of FUN results ?

Yves.Reecht at ifremer.fr Yves.Reecht at ifremer.fr
Wed Nov 10 21:34:25 CET 2010


Thank you very much Claudia,

That (the first form) works perfectly.
Easily made generic using head and tail on the dim attribute.

All the best,
Yves


Claudia Beleites <cbeleites at units.it> a écrit :

> Dear Yves,
>
> You may not need to do more than set the dim attribute correctly:
>
> dim (test) <- c (dim (myArray) [c (3 : 4, 1 : 2)]
> or
> dim (test) <- c (dim (myArray) [c (4 : 3, 1 : 2)]
>
> Claudia
>
>
> -- 
> Claudia Beleites
> Dipartimento dei Materiali e delle Risorse Naturali
> Università degli Studi di Trieste
> Via Alfonso Valerio 6/a
> I-34127 Trieste
>
> phone: +39 0 40 5 58-37 68
> email: cbeleites at units.it
>



More information about the R-help mailing list