From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hendy Subject: Re: run R code block in the background (currently emacs freezes when running code) Date: Fri, 25 Apr 2014 11:31:38 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60632) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wdj2K-0005Rp-2e for emacs-orgmode@gnu.org; Fri, 25 Apr 2014 12:31:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wdj2J-0002xp-AK for emacs-orgmode@gnu.org; Fri, 25 Apr 2014 12:31:40 -0400 Received: from mail-ob0-x236.google.com ([2607:f8b0:4003:c01::236]:61691) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wdj2J-0002xi-53 for emacs-orgmode@gnu.org; Fri, 25 Apr 2014 12:31:39 -0400 Received: by mail-ob0-f182.google.com with SMTP id uy5so4531438obc.13 for ; Fri, 25 Apr 2014 09:31:38 -0700 (PDT) In-Reply-To: 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: Xebar Saram Cc: org mode On Thu, Apr 24, 2014 at 12:09 PM, Xebar Saram wrote: > Hi all. how does one send the eval commands to the when running R code > blocks to RSS to the background? currently when i evaluate a long code > block it freezes Emacs until the process is done. here is an example code > block i use: > > #+BEGIN_SRC R :session R1 :results output > log.sga.270 <- glm(NSGA ~ > IQRfintempmabirth+sinetime+costime+age_centered+age_centered_sq+cig_preg+cig_pre+med_income+p_ospace+gender+prev_400+ > diab+hyper+lungd+diab_other+prevpret+as.factor(kess)+as.factor(MRN)+as.factor(edu_group)+as.factor(byob)+parity,data=bd,family=binomial) > summary(log.sga.270) > #+END_SRC > I didn't run this, but have trained machine learning models in the past which run for a while. You should be able to do C-g to un-freeze the cursor in Emacs, while the code will still be executed in your R session. Try doing C-c C-c to start that block, C-g, and then C-x b to switch to the R1 buffer. You should see that the cursor isn't on a prompt, which means R is busy, yet you're free to move around in your org buffer and keep writing or doing whatever you want, even though the R session is tied up. Best regards, John > > thx so much in advance > > Z