hi - running R 1.1.1 under LinuxPPC: i was pleasantly surprised to find that attaching .RData files was added somewhere along the line, but i am having trouble getting the sort of behavior that i got used to in S. specifically, i'd like to be able to attach() a file at pos=1 and edit its contents directly, then save() and detach() it. i know i can load() the file, but this merges its contents with the current global environment. i could attach() at pos=2, but that makes editing/creating/deleting awkward. i could q() and restart R from another directory, but that is also awkward. i guess i still haven't quite figured out how the global environment is supposed to work. when i attach(file, pos=1), R does something funny: it seems to do a load(file) and then put an empty (at least ls() sees it as empty) reference to the file in the search list at pos=2. i'm happy to modify my behavior from S as long as i can get a simple way to work on several separate projects. can't find this in the archives. thanks for any help. - peter -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Thu, 5 Oct 2000, Peter Perkins wrote:> hi - > > running R 1.1.1 under LinuxPPC: > > i was pleasantly surprised to find that attaching .RData files was added > somewhere along the line, but i am having trouble getting the sort of > behavior that i got used to in S. specifically, i'd like to be able to > attach() a file at pos=1 and edit its contents directly, then save() and > detach() it. i know i can load() the file, but this merges its contents > with the current global environment. i could attach() at pos=2, but > that makes editing/creating/deleting awkward. i could q() and restart R > from another directory, but that is also awkward. > > i guess i still haven't quite figured out how the global environment is > supposed to work. when i attach(file, pos=1), R does something funny: > it seems to do a load(file) and then put an empty (at least ls() sees it > as empty) reference to the file in the search list at pos=2.You can't attach at pos=1. This is in the FAQ, but needs to be in the documentation for attach(). At the moment you need to edit things in the global environment. You don't need to start R in another directory to do this. You can use the --no-restore flag and start in the same directory. -thomas -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
in response to my own question from yesterday,> i'd like to be able to attach() a file at pos=1 and edit its contents > directly, then save() and detach() iti hoked up some mods to the C and R source code of R 1.1.1 for unix. it obviously doesn't do exactly what i was used to from S, but it comes sort of close, in that it keeps track of a "current working file" (specified at startup and defaulting to .RData) in various ways and allows one to easily switch CWF (while saving the old one semi-automatically) without restarting. this as opposed to loading from a file and ending up with those objects merged with the current set of objects. seems to do what i need, anyway. is this list the appropriate forum to suggest this sort of thing for a future release? - peter -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._