R script stops working when I'm not actively using a computer

I am running a script that performs automatic reverse fetching on glmer models. The script executes successive drop1 () commands, automatically deleting the predictor with the highest p value after each step. This is very time consuming, so I want to leave it for the night, but R stops working when I leave the computer.

I am running R 3.1.1 in Snow Leopard. I have already set the System Preferences so that the computer does not sleep, and I also prevent sleep by running "pmset noidle" in Terminal. Despite all this, when I leave my script to run, it silently stops about 45 minutes after my last action (in any application) and silently resumes when I start using the computer again in the morning. I can tell approximately when the script is active, as it periodically prints timestamps. I pasted an example snippet of output at the bottom of this post (basically so that people can see timestamps). I understand that I get some warnings related to fitting the model, but I am sure that they do not cause a delay of 7.5 hours!

Has this happened to anyone else? Any suggestions on how to save my script while I am leaving the computer? I am new to the site, so please let me know what additional information I can provide.

[1] "Wed Feb 25 21:31:59 2015"
Single term deletions

Model:
Pref ~ Nut * Subfamily + Nut * Sex + Subfamily * Sex + DrinkDur + 
    TrialTime + holdDur + FeedOrder + (1 | SpCode/Indiv)
              Df    AIC    LRT   Pr(Chi)    
<none>           809.07                     
DrinkDur       1 810.77  3.703   0.05433 .  
TrialTime      1 807.06 -0.011   1.00000    
holdDur        1 807.37  0.306   0.58036    
FeedOrder      1 810.24  3.172   0.07490 .  
Nut:Subfamily 32 820.47 75.404 2.315e-05 ***
Nut:Sex        4 843.44 42.375 1.395e-08 ***
Subfamily:Sex  8 809.06 15.995   0.04245 *  
---
Signif. codes:  0 β€˜***’ 0.001 β€˜**’ 0.01 β€˜*’ 0.05 β€˜.’ 0.1 β€˜ ’ 1

[1] "Now dropping TrialTime"
[1] "Wed Feb 25 22:39:51 2015"
Single term deletions

Model:
Pref ~ Nut + Subfamily + Sex + DrinkDur + holdDur + FeedOrder + 
    (1 | SpCode/Indiv) + Nut:Subfamily + Nut:Sex + Subfamily:Sex
              Df    AIC    LRT   Pr(Chi)    
<none>           807.06                     
DrinkDur       1 808.72  3.665   0.05556 .  
holdDur        1 805.33  0.276   0.59950    
FeedOrder      1 808.19  3.134   0.07667 .  
Nut:Subfamily 32 818.18 75.125 2.523e-05 ***
Nut:Sex        4 841.42 42.360 1.405e-08 ***
Subfamily:Sex  8 807.18 16.125   0.04062 *  
---
Signif. codes:  0 β€˜***’ 0.001 β€˜**’ 0.01 β€˜*’ 0.05 β€˜.’ 0.1 β€˜ ’ 1
[1] "Now dropping holdDur"
[1] "Thu Feb 26 00:39:02 2015"
Single term deletions

Model:
Pref ~ Nut + Subfamily + Sex + DrinkDur + FeedOrder + (1 | SpCode/Indiv) + 
    Nut:Subfamily + Nut:Sex + Subfamily:Sex
              Df    AIC    LRT   Pr(Chi)    
<none>           805.33                     
DrinkDur       1 806.85  3.519   0.06066 .  
FeedOrder      1 806.47  3.134   0.07667 .  
Nut:Subfamily 32 816.48 75.144 2.508e-05 ***
Nut:Sex        4 839.69 42.357 1.407e-08 ***
Subfamily:Sex  8 805.55 16.220   0.03934 *  
---
Signif. codes:  0 β€˜***’ 0.001 β€˜**’ 0.01 β€˜*’ 0.05 β€˜.’ 0.1 β€˜ ’ 1
[1] "Now dropping FeedOrder"
[1] "Thu Feb 26 08:04:21 2015"
There were 50 or more warnings (use warnings() to see the first 50)
Single term deletions

Model:
Pref ~ Nut + Subfamily + Sex + DrinkDur + (1 | SpCode/Indiv) + 
    Nut:Subfamily + Nut:Sex + Subfamily:Sex
              Df    AIC    LRT   Pr(Chi)    
<none>           806.47                     
DrinkDur       1 808.10  3.636   0.05655 .  
Nut:Subfamily 32 819.11 76.647 1.574e-05 ***
Nut:Sex        4 840.14 41.678 1.945e-08 ***
Subfamily:Sex  8 806.69 16.222   0.03931 *  
---
Signif. codes:  0 β€˜***’ 0.001 β€˜**’ 0.01 β€˜*’ 0.05 β€˜.’ 0.1 β€˜ ’ 1
[1] "Now dropping DrinkDur"
[1] "Thu Feb 26 09:48:59 2015"
Single term deletions

Model:
Pref ~ Nut + Subfamily + Sex + (1 | SpCode/Indiv) + Nut:Subfamily + 
    Nut:Sex + Subfamily:Sex
              Df    AIC    LRT   Pr(Chi)    
<none>           808.10                     
Nut:Subfamily 32 821.02 76.918 1.446e-05 ***
Nut:Sex        4 842.05 41.944 1.713e-08 ***
Subfamily:Sex  8 807.25 15.147   0.05635 .  
---
Signif. codes:  0 β€˜***’ 0.001 β€˜**’ 0.01 β€˜*’ 0.05 β€˜.’ 0.1 β€˜ ’ 1
[1] "Now dropping Subfamily:Sex"
[1] "Thu Feb 26 10:02:58 2015"
Single term deletions

Model:
Pref ~ Nut + Subfamily + Sex + (1 | SpCode/Indiv) + Nut:Subfamily + 
    Nut:Sex
              Df    AIC    LRT   Pr(Chi)    
<none>           807.25                     
Nut:Subfamily 32 829.94 86.695 6.160e-07 ***
Nut:Sex        4 849.83 50.576 2.737e-10 ***
---
Signif. codes:  0 β€˜***’ 0.001 β€˜**’ 0.01 β€˜*’ 0.05 β€˜.’ 0.1 β€˜ ’ 1
+4
source share
1 answer

I'm not sure why you had this problem, given the settings you used to prevent reinstalling the computer (did you also disable the screen saver?).

Let me just solve the problem, and not try to find out why your computer enters a standby or inactive state, despite trying to prevent this from happening with the settings.

Here is what you should do:

  • Open a terminal window (you can find it in the spotlight)
  • screen, , (, , Linux, )
  • script , R script: /usr/bin/Rscript "/Users/usr/Documents/longscript.R"

. , Caffeinate .

+1

All Articles