Ottorino-Luca Pantani
2009-Aug-20 08:48 UTC
[R] [Fwd: Re: Several simple but hard tasks to do with R]
Rakknar ha scritto:> Hello everybody. I've been learning R for about a month to do a > econometric study and now i'm stuck with some problems to make R do the > things I want. Here I give the list of things I wanna do from the most > simple to the more complex (for me of course): > > 1. Make a log. I've been using Stata and there i have a great tool to > register what the program do: the log file, wich it's a simple .txt file > where Stata writes every output it makes (not graphics of course). When I > wanted to make the same thing with R I started to use the function sink() > but it only register the results of the commands (summaries for example) and > not the commands itself, witch it's really uncomfortable because it's harder > to find out to witch command that results come from. > > 2. Saving objects in a .Rdata step by step. I want to save several > regressions of interest in one .Rdata file. I want to save this results one > by one. For example: make regression 1, save the result in the .Rdata file; > then make the regression 2 and save the results in the same .Rdata file. I > know I could make all the regressions and save the results all at once but > for the kind of study I want to make It would be much useful this way. I've > been using function save() but I only could save one result or all. >As far as I can understand, you are running the commands from the command line, right ? I did this at the very beginning, but then I realize that are better way of dealing with R, that is let R do the calculations and other software do the editing of the scripts, saving data, code and so on. Consider the use of emacs + ESS + R. http://ess.r-project.org/ This will complicate things a little more, (A LOT !) but you will not regret the time spent in learning. Emacs will be useful in MANY other ways. -- Ottorino-Luca Pantani, Universit? di Firenze Dip. Scienza del Suolo e Nutrizione della Pianta P.zle Cascine 28 50144 Firenze Italia Tel 39 055 3288 202 (348 lab) Fax 39 055 333 273 OLPantani at unifi.it http://www4.unifi.it/dssnp/