From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hendy Subject: Including multiple plots resulting from a loop of R code in LaTeX Date: Wed, 22 Aug 2012 12:41:11 -0500 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:35169) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4EvZ-0000fa-Rd for emacs-orgmode@gnu.org; Wed, 22 Aug 2012 13:41:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T4EvY-000216-UA for emacs-orgmode@gnu.org; Wed, 22 Aug 2012 13:41:13 -0400 Received: from mail-qc0-f169.google.com ([209.85.216.169]:45917) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4EvY-00020y-Pq for emacs-orgmode@gnu.org; Wed, 22 Aug 2012 13:41:12 -0400 Received: by qcsd16 with SMTP id d16so1002371qcs.0 for ; Wed, 22 Aug 2012 10:41:11 -0700 (PDT) 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 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? Thanks, John