Dear R developers, i would like to start R with a *.RData argument under Linux. Something like R -f /home/user/workspace.RData Is this possible? Thanks in advance for any answers. -- View this message in context: http://www.nabble.com/Execute-R-with-*.RData-argument-tp16323374p16323374.html Sent from the R help mailing list archive at Nabble.com.
On Thu, 27 Mar 2008, Bio7 wrote:> > Dear R developers, > > i would like to start R with a *.RData argument under Linux. > Something like R -f /home/user/workspace.RData > > Is this possible?$ R ...> load("/home/user/workspace.RData")or put that line in your .Rprofile -- see ?Startup. (My guess is that you are used to the facility for drag-and-drop on Windows. Also, please re-read 'An Introduction to R' for the supported command-line arguments -- '-f' is supported but this is not what it does.)> > Thanks in advance for any answers. > -- > View this message in context: http://www.nabble.com/Execute-R-with-*.RData-argument-tp16323374p16323374.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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. >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
$ R ...> load("/home/user/workspace.RData")or put that line in your .Rprofile -- see ?Startup. (My guess is that you are used to the facility for drag-and-drop on Windows. Also, please re-read 'An Introduction to R' for the supported command-line arguments -- '-f' is supported but this is not what it does.) That' s not exactly what i need because i externally execute the R environment in a shell which then should automatically load a given *.RData file. It would be nice to have an argument for R which avoids the termination of R when using the R -e argument then i can programmatically open a shell with a given file. Anyway the .RProfile file could be an option for me. Thank you for the help! -- View this message in context: http://www.nabble.com/Execute-R-with-*.RData-argument-tp16323374p16325202.html Sent from the R help mailing list archive at Nabble.com.
Not sure if this is sufficient but if you always open your RData file in the same directory this may be good enough: mkdir ~/tmp cd ~/tmp R x <- 33 q() # answer y to save in .RData Now whenever you open R in ~/tmp it will load .RData containing x. You must be in ~/tmp and the file must be called .RData . If you subsequently quit again in a subsequent session press y to update .RData for the subsequent session or n if you want to keep the first .RData. On Thu, Mar 27, 2008 at 5:02 AM, Bio7 <marcel.austenfeld at uni-bielefeld.de> wrote:> > Dear R developers, > > i would like to start R with a *.RData argument under Linux. > Something like R -f /home/user/workspace.RData > > Is this possible? > > Thanks in advance for any answers. > -- > View this message in context: http://www.nabble.com/Execute-R-with-*.RData-argument-tp16323374p16323374.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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. >
Thanks for the nice tip. I also consider to use the clipboard to transfer a command with the file path which then can be pasted easily in the shell and executed. Gabor Grothendieck wrote:> > Not sure if this is sufficient but if you always open your RData > file in the same directory this may be good enough: > > mkdir ~/tmp > cd ~/tmp > R > x <- 33 > q() # answer y to save in .RData > > Now whenever you open R in ~/tmp it will load .RData containing x. > You must be in ~/tmp and the file must be called .RData . If you > subsequently > quit again in a subsequent session press y to update .RData for the > subsequent > session or n if you want to keep the first .RData. > > On Thu, Mar 27, 2008 at 5:02 AM, Bio7 > <marcel.austenfeld at uni-bielefeld.de> wrote: >> >> Dear R developers, >> >> i would like to start R with a *.RData argument under Linux. >> Something like R -f /home/user/workspace.RData >> >> Is this possible? >> >> Thanks in advance for any answers. >> -- >> View this message in context: >> http://www.nabble.com/Execute-R-with-*.RData-argument-tp16323374p16323374.html >> Sent from the R help mailing list archive at Nabble.com. >> >> ______________________________________________ >> 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. >> > > ______________________________________________ > 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. > >-- View this message in context: http://www.nabble.com/Execute-R-with-*.RData-argument-tp16323374p16331147.html Sent from the R help mailing list archive at Nabble.com.