in reply to Transpose an array and the perl equivalent of R cbind?

Perhaps if you used Data::Dump or Data::Dumper to output your data structure and posted a few lines somebody would be able to help.

gav^

  • Comment on Re: Transpose an array and the perl equivalent of R cbind?

Replies are listed 'Best First'.
Re: Re: Transpose an array and the perl equivalent of R cbind?
by dargosch (Scribe) on Apr 25, 2002 at 05:50 UTC

    Dumping my data in a post may not be such a good idea, since it involves a 10,000x100 array/matrix.

    I'll give you a hands-on example though:

    %myHash = (var1 => [1,2,3,4,5,6], var2 => [11,12,13,14,15,16]);
    is what I've got, and this is what I would like to have:
    @myArray = ([1,11], [2,12], [3,13], [4,14], [5,15], [6,16]);
    which of course would be converted to a data.frame in R (which is not part of the question, but I would of course be really thankful for fast and efficient Perl -> R code too).
      You may want to look at mapchar by tye.

      -Lee

      "To be civilized is to deny one's nature."