DocJon / pbs-admb

Automatically exported from code.google.com/p/pbs-admb
0 stars 0 forks source link

admb() doesn't read ADopts.txt automatically in the current working directory #37

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I thought that admb() would automatically read ADopts.txt if that file appears 
in the current working directory. But it doesn't.

I have a directory with a valid ADopts.txt file, but when I open admb() in that 
directory, I have to click the buttons "Load" and "Apply" to get the right 
paths in the GUI.

I think this applies to all operating systems.

Original issue reported on code.google.com by schnu...@shaw.ca on 15 Mar 2011 at 6:42

GoogleCodeExporter commented 9 years ago
can't replicate on windows 7. Will look into code.

Original comment by alex_goo...@mofo.ca on 15 Mar 2011 at 7:26

GoogleCodeExporter commented 9 years ago
ADopts.txt should be loaded when .initOptions() is called (done by admb()).
This call will fail if .PBSadmb already exists, which prevents .initOptions() 
from being called.

If R is started with a pre existing evironment which already contains .PBSadmb; 
this call will fail to load the options. 

Jon: Please try this from a clean start of R - does it still occur?

This however raises a good question, if a preexisting R session is loaded, 
should we try to reload the variables from disk, or use the last known 
variables stored by the user in R's memory. If we try to reload from disk, 
we'll have to do it everytime admb() is called, or perhaps do it in the zzz.r 
startup (not sure if this gets called if an existing R session is resumed from 
disk).

Original comment by alex_goo...@mofo.ca on 15 Mar 2011 at 7:32

GoogleCodeExporter commented 9 years ago
Resuming from a previously saved workspace does infact prevent ADopts.txt from 
being read - This seems like a logical decision.

If however, I run a Remove all objects -  "rm(list=ls(all=TRUE))"
then reload library(PBSadmb); admb();
it does infact reload the ADopts.txt

Original comment by alex_goo...@mofo.ca on 16 Mar 2011 at 5:17

GoogleCodeExporter commented 9 years ago
save session prevented it from being read.

now admb() always reads the files (rather than during require() phase)

Original comment by alex_goo...@mofo.ca on 23 Mar 2011 at 6:49