[R] Problems with environmental variables set with Sys.putenv

David Brahm
2001-11-30T20:02:07Z

Environment variables set with Sys.putenv() "disappear" spontaneously
(and
somewhat randomly) when I load large datasets.

This was reported in R-help by Dave Kane on June 4, 2001; I have not seen any
further discussion.  I'm not sure if I can report it as a "bug",
since it is
not entirely reproducible.  Could someone try this and see if you have trouble
too?  The following ought to be an infinite loop, but isn't:

R> x <- matrix(1., 3000, 3000)
R> save(x, file="myx.RData")
R> Sys.putenv(HOME="/tmp")
R> while (Sys.getenv("HOME") != "")
{cat("ok\n"); load("myx.RData")}
ok
ok
R>

The number of ok's I get varies from try to try.  Weird!

Version:
 platform = sparc-sun-solaris2.6
 arch = sparc
 os = solaris2.6
 system = sparc, solaris2.6
 status =
 major = 1
 minor = 3.1
 year = 2001
 month = 08
 day = 31
 language = R

Search Path:
 .GlobalEnv, package:misc, package:io, package:arrays, package:ls1, package:db,
package:ts, package:ctest, Autoloads, package:base
--
                              -- David Brahm (brahm at alum.mit.edu)
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at
stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._