From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hendy Subject: Re: Problem with babel and R + lattice Date: Fri, 9 Mar 2012 08:04:15 -0600 Message-ID: References: <4F59C257.2060401@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:52939) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S60Qs-0004SD-Gq for emacs-orgmode@gnu.org; Fri, 09 Mar 2012 09:04:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S60Qc-000490-25 for emacs-orgmode@gnu.org; Fri, 09 Mar 2012 09:04:34 -0500 Received: from mail-bk0-f41.google.com ([209.85.214.41]:39515) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S60Qb-00046S-Oe for emacs-orgmode@gnu.org; Fri, 09 Mar 2012 09:04:17 -0500 Received: by bkwq16 with SMTP id q16so1452030bkw.0 for ; Fri, 09 Mar 2012 06:04:15 -0800 (PST) In-Reply-To: <4F59C257.2060401@gmail.com> 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: R.M.Krug@gmail.com Cc: emacs-orgmode On Fri, Mar 9, 2012 at 2:41 AM, Rainer M Krug wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 08/03/12 21:52, John Hendy wrote: >> Drat. I meant to add that when I run the code exactly as I have it from = R directly, it works. I >> literally copy and paste my org-mode babel block code line by line into = a terminal and obtain >> the proper output via tikz. *That's* the perplexing part. What would be = working directly from R >> and not from Org-mode? >> >> For reference, I've generated plenty of stuff just like this via org-mod= e/babel. Come to think >> of it, even another lattice plot. >> >> Not sure how to pinpoint what's goofy about this specific plot. >> >> John >> >> On Thu, Mar 8, 2012 at 2:40 PM, John Hendy wrote: >>> I have an R block like so: >>> >>> #+begin_src R >>> >>> library(lattice) library(tikzDevice) >>> >>> =3Dbunch of code=3D >>> >>> barchart(side$name~side$x2,groups=3Dside$type,horiz=3DT, >>> xlim=3Dc(0,0.75),col=3Dc("lightblue","yellow"),xlab=3D"Product Performa= nce (2-box)") >>> >>> dev.off() tools::texi2dvi("bar-2b.tex",pdf=3DT) >>> >>> #+end_src >>> >>> The resultant tex file is empty where the tikz code should be and texi2= dvi fails. Any >>> suggestions? If I change my plot to base graphics with barplot, it work= s. I'm thinking this >>> is a lattice/babel issue? > > As with ggplot, you have to print your plot (if I remember correctly), i.= e: > > print(barchart(...)) I stumbled on this, too but hadn't posted back to the list yet. What got me on the track to the solution was copying my babel block code into an R source file and trying to do =3D > source("path/to/file")=3D directly from R. That wasn't working either, so I knew it was something I was doing and not org. I found the R faq which said that source files don't generate output for everything unless you tell them to print() :) Thanks! John > > Cheers, > > Rainer > >>> >>> >>> Thanks for any input, John >> > > > - -- > Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biolog= y, UCT), Dipl. Phys. > (Germany) > > Centre of Excellence for Invasion Biology > Stellenbosch University > South Africa > > Tel : =C2=A0 =C2=A0 =C2=A0 +33 - (0)9 53 10 27 44 > Cell: =C2=A0 =C2=A0 =C2=A0 +33 - (0)6 85 62 59 98 > Fax : =C2=A0 =C2=A0 =C2=A0 +33 - (0)9 58 10 27 44 > > Fax (D): =C2=A0 =C2=A0+49 - (0)3 21 21 25 22 44 > > email: =C2=A0 =C2=A0 =C2=A0Rainer@krugs.de > > Skype: =C2=A0 =C2=A0 =C2=A0RMkrug > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.11 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAk9ZwlcACgkQoYgNqgF2egqMewCfar+JxC9uV9p1O2IYVVYcqyeM > 7/4AnRLp8gYqSDe/74D9helafqNR5Vgt > =3DaDVb > -----END PGP SIGNATURE-----