Re: [R] passing username and password to source()

From: Dieter Menne <dieter.menne_at_menne-biomed.de>
Date: Thu, 14 Feb 2008 07:18:19 +0000 (UTC)

[Ricardo Rodriguez] Your XEN ICT Team <webmaster <at> xen.net> writes:

> But considering I am just newbie, could you point me to any example to
> get this working? Thanks!
>

I was thinking of something like this (note: you must store PassEnv2.r on disk as a file).

# File PassEnv.r
Sys.setenv(PASSW="mypass")
source("PassEnv2.r")
Sys.unsetenv("PASSW")
# Try again (to show it's removed)
source("PassEnv2.r")

#File PassEnv1.r
passw=Sys.getenv("PASSW")
# Sys.unsetenv("PASSW") ## This would also be possible to clear the enviroment # Show that is worked
cat("The password is ",passw,"\n")

Again: this is good for your own computer, but should not be used when security constraints are relevant. The password is visible to everyone for the time of passenv1.r running.

Dieter



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 14 Feb 2008 - 07:25:10 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 14 Feb 2008 - 08:30:13 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive