ivo_welch-rstat8783@mailblocks.com
2004-Jul-03 15:45 UTC
[R] options --- na.rm , save-on-exit
dear R wizzards: two options() related questions. [a] options(na.action): many of my variables have missing variables, so I would like to set a default to ignore, especially in univariate functions like mean() and median() . alas, without na.rm=T in the functions themselves, I always get an NA. my code is full of na.rm=T is there a magic invokation of options with na.action that is honored by these functions? [b] options(?): how do I get R to not prompt me for saving the workspace upon exit, but to instead automatically save the command history .Rhistory but not the data .RData ? help appreciated. sincerely, /iaw --- ivo welch professor of finance and economics brown / nber / yale
ivo_welch-rstat8783 at mailblocks.com wrote:> > dear R wizzards: two options() related questions. > > [a] options(na.action): many of my variables have missing variables, so > I would like to set a default to ignore, especially in univariate > functions like mean() and median() . alas, without na.rm=T in the > functions themselves, I always get an NA. my code is full of na.rm=T is > there a magic invokation of options with na.action that is honored by > these functions?No.> [b] options(?): how do I get R to not prompt me for saving the workspace > upon exit, but to instead automatically save the command history > .Rhistory but not the data .RData ?you can define a function like: Q <- function (save = "no", status = 0, runLast = TRUE){ savehistory() .Internal(quit(save, status, runLast)) } and call Q(), if you want to exit. Uwe Ligges> help appreciated. > > sincerely, > > /iaw > --- > ivo welch > professor of finance and economics > brown / nber / yale > > ______________________________________________ > 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
On Sat, 3 Jul 2004 ivo_welch-rstat8783 at mailblocks.com wrote:> [b] options(?): how do I get R to not prompt me for saving the > workspace upon exit, but to instead automatically save the command > history .Rhistory but not the data .RData ?The first is in the appendix to An Introduction to R: --no-save etc. For the second, see ?savehistory and especially its example. -- 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