Christoph Lange
2004-Jan-27 10:42 UTC
[R] Directory-like data organisation w/ environments?
Dear r-users! I wonder if there is a way of designing a directory like structure for holding my data using environments? It would be nice if I could implement a kind of 'cd' command to change to a differend environment etc. Can anybody give me a hint? -cl -- Christoph Lange MPI fuer biologische Kybernetik |Phone: +49-7071-601-607| Postfach 2169, D-72012 Tuebingen |FAX: +49-7071-601-616|
Would attaching a nested list be close to what you want? E.g.,> x <- list(y1 = list(z = matrix(1:4, 2, 2)), y2=matrix(0, 3, 2)) > attach(x) > y2[,1] [,2] [1,] 0 0 [2,] 0 0 [3,] 0 0> attach(y1) > z[,1] [,2] [1,] 1 3 [2,] 2 4 You should be aware that the global environment is #1 on the search list, and you can't attach anything else at position 1. So if you have something in the workspace that has the same name as in what you attach()'ed, the one in the workspace is seen. HTH, Andy> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Christoph Lange > Sent: Tuesday, January 27, 2004 5:43 AM > To: R Help List > Subject: [R] Directory-like data organisation w/ environments? > > > > Dear r-users! > > I wonder if there is a way of designing a directory like structure for > holding my data using environments? > > It would be nice if I could implement a kind of 'cd' command to change > to a differend environment etc. > > Can anybody give me a hint? > > -cl > > -- > Christoph Lange > MPI fuer biologische Kybernetik |Phone: +49-7071-601-607| > Postfach 2169, D-72012 Tuebingen |FAX: +49-7071-601-616| > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html > >------------------------------------------------------------------------------ Notice: This e-mail message, together with any attachments,...{{dropped}}
Dear Christoph, Take a look at the cd function (and others) in the mvbutils package. I hope that this helps, John At 11:42 AM 1/27/2004 +0100, Christoph Lange wrote:>Dear r-users! > >I wonder if there is a way of designing a directory like structure for >holding my data using environments? > >It would be nice if I could implement a kind of 'cd' command to change >to a differend environment etc. > >Can anybody give me a hint? > >-cl____________________________ John Fox Department of Sociology McMaster University email: jfox at mcmaster.ca web: http://www.socsci.mcmaster.ca/jfox
Mark.Bravington@csiro.au
2004-Feb-04 03:14 UTC
[R] Directory-like data organisation w/ environments?
> -----Original Message----- > > Dear r-users! > > I wonder if there is a way of designing a directory like > structure for holding my data using environments? > > It would be nice if I could implement a kind of 'cd' command > to change to a differend environment etc. > > Can anybody give me a hint? > > -clHi Christophe You might want to check out the 'mvbutils' package on CRAN, and specifically those sections relating to the 'cd' command. This allows you to create & maintain a hierarchical project structure (like a directory tree). You can switch between workspaces within a single R session, search thru the hierarchy, move stuff around, etc. [A colleague passed on your email to me-- he may already have sent you this info directly.] Hope this helps Mark ******************************* Mark Bravington CSIRO (CMIS) PO Box 1538 Castray Esplanade Hobart TAS 7001 phone (61) 3 6232 5118 fax (61) 3 6232 5012 Mark.Bravington at csiro.au