Hello Russell,
I also use S+ on a Linux server through Emacs' ESS. Here is how I select
the working directory associated with the project I work on at the moment.
First I always start S+ on the same directory, the one in the "MySwork"
directory. In this directory I do have a ".First" function which attaches
my own library.
Second in my personnal library I have an "autoexe" function which takes as
argument a directory name, of course I supply the directory where I want to
navigate and work.
Third I also have a "chdir" function which allows to switch working
directory, if required, during an Splus session.
I have been working that way on Windows, Unix and Linux versions of Splus
for years and it has served my purpose well. Below you will find the
"autoexe" and the "chdir" functions. You may need to adapt the functions
to suit your own needs.
"autoexe" <- function(datadir, default.path = '/actuaria/jeg002/')
{
# Author : Gérald Jean
# Date : 1995
# Updates :
# Purpose : will attach "datadir" at position 1 in the search path and my
# personnal functions at position 2.
# Arguments :
# datadir : the name of the data directory to attach at position 1.
# default.path : the path leading to the directory "datadir".
# Revisions: GJ (15/11/99)
# GJ (15/02/01) --- Added the "default.path" argument.
if (!missing(datadir))
{to.attach <- paste(default.path, datadir, "/.Data", sep = "")
attach(to.attach, pos = 1)
detach(2)
cat(paste('\n\tLe repertoire ', to.attach, sep = ''), sep = '\n')
cat('\n\t attache en position 1.', sep = '\n')
}
else cat(paste('\n\tL\'argument \"datadir\" est manquant; aucune base de
',
'donnees attachees.', sep = ''), sep = '\n')
invisible()
}
"chdir" <- function(datadir, default.path = '/actuaria/jeg002/')
{
# Author : Gerald Jean
# Date : May 1999
# Purpose : will delete all objects starting with "ttt*" from directory
# currently at position 1 in the search path and will detach that
# directory. Then "newdir" will be attached at position 1.
# Arguments:
# datadir : the directory to attach.
# default.path : the drive on which resides the directory to attach.
# Updates: 15/02/01 GJ --- Added the "default.path" argument.
# 04/10/01 GJ --- Used the new "regexpr.pattern" from S+6.
# 22/05/02 GJ --- Adapted to run under Unix.
#------------------------------------------------------------------------
data.dir.to.detach <- search()[1]
remove(objects(regexpr.pattern = "^ttt", where = 1), where = 1)
to.attach <- paste(default.path, datadir, "/.Data", sep = "")
attach(to.attach, pos = 1)
detach(what = data.dir.to.detach)
search()
}
Hoping you can make use of these,
Gérald Jean
Conseiller senior en statistiques,
VP Planification et Développement des Marchés,
Desjardins Groupe d'Assurances Générales
télephone : (418) 835-4900 poste (7639)
télecopieur : (418) 835-6657
courrier électronique: gerald.jean@dgag.ca
"In God we trust, all others must bring data" W. Edwards Deming
"Russell Ivory"
<Russell.Ivory@Me
rrickBank.com> A
Envoyé par : <s-news@lists.biostat.wustl.edu>
s-news-owner@list cc
s.biostat.wustl.e "David Wiltsee"
du <david.wiltsee@MerrickBank.com>,
"Kody Bloomquist"
<Kody.Bloomquist@MerrickBank.com>
2008/07/18 13:50 Objet
[S] .Data on Linux server
Veuillez répondre
à
s-news@lists.bios
tat.wustl.edu
I’ve been creating a separate .Data directory for each project in the
Windows environment simply by creating a shortcut on the desktop and
setting the attributes of the shortcut to point to the given path for that
project. S-Plus then creates the .Data the first time I use the shortcut.
Another method of course is to use the GUI and select Options, General
Settings, and checking the box ‘Set S_PROJ to Working Directory’.
We’ve recently migrated over to a Linux platform and I need once again to
create separate .Data directories for each project. I have a critical
project called ‘pipeline’ where I need to keep the .Data or S_PROJ clean
and untouched by anything else. This project resides at
~/pipeline
When I start a new project in S-Plus on the Linux server, I go to my
project directory and as I start S-Plus I’m prompted where to start the
working directory as follows:
ESS [S(S+6): /usr/local/bin/Splus] starting data directory?
~/MySwork/betaproject/
However, this new project may have its own working directory where it will
read and write files, but it uses the pipeline S_PROJ data base.
Can someone give me instructions for setting the S_PROJ to individual
directories for individual projects on the Linux platform?
Thank you in advance,
Russell Ivory
Merrick Bank
South Jordan, UT
****************************************************************************This
e-mail and any files
transmitted with it are confidential and are intended solely for the use of
the individual or entity to whom it
is addressed. If you are not the intended recipient or the person responsible
for delivering the e-mail to the
intended recipient, be advised that you have received this e-mail in error,
and that any use, dissemination,
forwarding, printing, or copying of this e-mail is strictly prohibited. If you
received this e-mail in error,
please return the e-mail to the sender at Merrick Bank and delete it from your
computer. Although Merrick Bank
attempts to sweep e-mail and attachments for viruses, it does not guarantee
that either are virus-free and
accepts no liability for any damage sustained as a result of viruses.
Faites bonne impression et imprimez seulement au besoin !
Think green before you print !
Le message ci-dessus, ainsi que les documents l'accompagnant, sont destinés
uniquement aux personnes identifiées et peuvent contenir des informations
privilégiées, confidentielles ou ne pouvant être divulguées. Si vous avez reçu
ce message par erreur, veuillez le détruire.
This communication (and/or the attachments) is intended for named recipients
only and may contain privileged or confidential information which is not to be
disclosed. If you received this communication by mistake please destroy all
copies.
|