From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Landis Subject: Re: problems with R graphics Date: Thu, 1 Mar 2012 02:47:09 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:41308) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2w3A-0003VF-98 for emacs-orgmode@gnu.org; Wed, 29 Feb 2012 21:47:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S2w38-0005Z8-6X for emacs-orgmode@gnu.org; Wed, 29 Feb 2012 21:47:23 -0500 Received: from plane.gmane.org ([80.91.229.3]:48472) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2w38-0005Yf-0F for emacs-orgmode@gnu.org; Wed, 29 Feb 2012 21:47:22 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1S2w35-0006ZK-15 for emacs-orgmode@gnu.org; Thu, 01 Mar 2012 03:47:19 +0100 Received: from c-75-69-36-245.hsd1.vt.comcast.net ([75.69.36.245]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 01 Mar 2012 03:47:19 +0100 Received: from landis by c-75-69-36-245.hsd1.vt.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 01 Mar 2012 03:47:19 +0100 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 Matthew Landis isciences.com> writes: > > Hello all, ... > Unfortunately, I can't seem to get graphics > to insert themselves properly on export. .... > org example > ---------------------------- ... > * A stand-alone code block > > First, create some data, perform a regression, and plot it. This > works great. > #+begin_src R :results graphics :file regress.png :exports both > > x <- runif(n = 100, min = 0, max = 20) > y <- 5*x^2 + 0.3*x + 3 + rnorm(100, sd = 200) > > f <- lm(y ~ x) > > plot(x, y, bty = 'n') > abline(f, lty = 'dashed') > > #+end_src > Success. ... > #+begin_src R :session :results graphics :file regress_session.png :exports both > > plot(x, y, bty = 'n') > abline(f, lty = 'dashed') > > #+end_src > This code block doesn't work. No error, but no file is created. ... I actually figured this one out just now. If creating a file in a 'stand alone' code block, the default directory is the directory that the org file itself is in. However, in a 'session' code block, the default directory is something else (R's default?). If I specify the full path to the file in the 'session' code block, things work better. Sorry for the noise! M