From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: Combine tables which are results from calculations? Date: Thu, 05 Nov 2015 09:20:36 +0100 Message-ID: References: <20151103202732.GA10994@eyeBook.home> <20151104175046.GA19168@eyeBook.home> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38804) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuFmt-00033t-8z for emacs-orgmode@gnu.org; Thu, 05 Nov 2015 03:20:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZuFmp-0002Fi-9p for emacs-orgmode@gnu.org; Thu, 05 Nov 2015 03:20:51 -0500 Received: from mail-wm0-f52.google.com ([74.125.82.52]:35999) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuFmp-0002FU-3b for emacs-orgmode@gnu.org; Thu, 05 Nov 2015 03:20:47 -0500 Received: by wmww144 with SMTP id w144so1132740wmw.1 for ; Thu, 05 Nov 2015 00:20:46 -0800 (PST) Received: from Rainers-MacBook-Pro.local ([88.186.171.7]) by smtp.gmail.com with ESMTPSA id 5sm32795890wmg.14.2015.11.05.00.20.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Nov 2015 00:20:44 -0800 (PST) In-Reply-To: <20151104175046.GA19168@eyeBook.home> (Rick Frankel's message of "Wed, 4 Nov 2015 12:50:46 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Rick Frankel writes: > On Wed, Nov 04, 2015 at 10:03:48AM +0100, Rainer M Krug wrote: >> Rick Frankel writes: >> >> > On Tue, Nov 03, 2015 at 02:18:05PM +0100, Rainer M Krug wrote: >> >> Hi >> >> >> >> Considering the following example: >> > >> > here's a way to do it in ruby. There is probably a way in {emacs,cl}-l= isp, but >> > I'm not sure how... >> > >> > #+BEGIN_SRC ruby :var a=3Dt1[,0] b=3Dt2[,0] c=3Dt3[,0] :colnames '(a b= c) >> > r =3D [a, b, c] >> > len =3D r.collect(&:length).max >> > r.each { |l| l.fill('', l.length, len - l.length) } >> > a.zip(b, c) >> > #+END_SRC >> >> Thanks - I'll look into this and see if I can do something similar in R >> or elisp. > > Here's a elisp version: > > * zip lists > #+name: a > | a | > |---| > | 1 | > | 2 | > > > #+name: b > | b | > |---| > | 4 | > | 5 | > | 6 | > | 7 | > | 8 | > > #+name: c > | c | > |----| > | 9 | > | 10 | > | 11 | > > #+BEGIN_SRC emacs-lisp :var a=3Da[,0] b=3Db[,0] c=3Dc[,0] :colnames '(a b= c) > (let* ((l (list a b c)) > (max (apply #'max (mapcar #'length l)))) > (apply > #'mapcar* #'list > (mapcar (lambda (x) (append x (make-list (- max (length x)) ""))) l)= )) > #+END_SRC Thanks a lot - I think this should possibly go ito worg? I'll keep it for reference as I implemented the whole layouting in R. Thanks, Rainer > > > rick > > Note: previous reply was not to list (whoops) CC'ing the list on this so = the > answer is saved for posterity :). =2D-=20 Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,= UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: Rainer@krugs.de Skype: RMkrug PGP: 0x0F52F982 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJWOxFZAAoJENvXNx4PUvmCCToH/3mNoGBuY79DDU9Hi7ptCjGW eZ8DI+O7mSik1s1NTar7btjud/uIgHWkIIpxbz6UtPa3OFYQq4DDOuUUjsOcp+6m TJWaUBS5/AH3YTy9s64Fcvr395d9qYHWBdKJ+92Eoop9xoynjKj4eXzFHVAl7y2Z p0Jd1TZ+NCDbXHiopK07S9YMoG6sk9u3XQWfhSFa365rv0I43tD2+8GJYGvIGCbT m60LylNJ2JvDzVJeByEZQISQDuuhILrYzDgXgf3M6ah3x2cnyW5JOrxafLc1+rXP eHbRP1S2t0d29hd5FA2rN2yc2glmn1AGcgLJUtz+KUKMMjxtTeQWHeKH+eA3UJA= =kON2 -----END PGP SIGNATURE----- --=-=-=--