From: Eric Schulte <eric.schulte@gmx.com>
To: John Hendy <jw.hendy@gmail.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Including multiple plots resulting from a loop of R code in LaTeX
Date: Thu, 23 Aug 2012 10:43:10 -0600 [thread overview]
Message-ID: <87wr0p4l0h.fsf@gmx.com> (raw)
In-Reply-To: <CA+M2ft-vX1+eSAsprBf_xocA5+uB3hFowSbgqR6tNM3z0ng9zQ@mail.gmail.com> (John Hendy's message of "Wed, 22 Aug 2012 12:41:11 -0500")
John Hendy <jw.hendy@gmail.com> writes:
> I'm conducting some neural network analysis, and the results are
> highly dependent on the random seed set prior to creating the model. I
> loop through seeds 1-500, storing the predicted values in one data
> frame and a table of mean sum of squared errors in another table.
>
> Then, I use ggplot to create only the 10 or so plots with the lowest
> error. The loop is something like this:
>
> ----------
> for(i in 1:10) {
>
> filename <- paste("neuralnet-","-seed-",as.character(mse[i,1]),".pdf", sep="")
>
> pdf(filename, width=12, height=8)
>
> [ggplot code]
>
> dev.off()
> ----------
>
> What I want to know is how to include the resultant files in LaTeX
> export. Since my model runs and then sorts by error, I don't know
> which seeds produce the best files beforehand, so I'd have to look at
> the error table and manually insert the plot names by hand. Changing
> results means changing file names by hand again.
>
> Any suggestions for things like this where the output of a babel block
> is not a single file?
>
Have you tried using header arguments like the following.
:results output raw :exports results
and then printing the file names (including the Org-mode link syntax) to
STDOUT from within your R code block.
If I understand correctly that should result in the behavior you're
after.
Best,
>
>
> Thanks,
> John
>
--
Eric Schulte
http://cs.unm.edu/~eschulte
next prev parent reply other threads:[~2012-08-23 17:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-22 17:41 Including multiple plots resulting from a loop of R code in LaTeX John Hendy
2012-08-23 16:43 ` Eric Schulte [this message]
2012-08-27 2:58 ` John Hendy
2012-08-27 3:15 ` John Hendy
2012-08-27 3:24 ` John Hendy
2012-08-27 20:16 ` John Hendy
2012-08-27 20:40 ` Nick Dokos
2012-08-27 21:40 ` John Hendy
2012-08-27 20:50 ` Eric Schulte
2012-08-27 21:37 ` John Hendy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wr0p4l0h.fsf@gmx.com \
--to=eric.schulte@gmx.com \
--cc=emacs-orgmode@gnu.org \
--cc=jw.hendy@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.