[R] Modify base R functions in Rprofile.site

Yihui Xie xieyihui at gmail.com
Sun Oct 4 08:28:49 CEST 2009


Hi everyone,

I want to modify two base R functions 'parse' and 'deparse'
immediately after R has started, so I added some code in the file
'Rprofile.site' under the 'etc' directory. Here is a simple example:

parse=function(...){
    base::parse(...)
}

I'll get an error when I start R as follows:

Error: cannot change value of locked binding for 'parse'

Is there a solution for my problem? Please note that I *have to*
override the function names. Thanks very much!

> sessionInfo()
R version 2.9.2 (2009-08-24)
i386-pc-mingw32

locale:
LC_COLLATE=Chinese_People's Republic of
China.936;LC_CTYPE=Chinese_People's Republic of
China.936;LC_MONETARY=Chinese_People's Republic of
China.936;LC_NUMERIC=C;LC_TIME=Chinese_People's Republic of China.936

attached base packages:
[1] datasets  utils     stats     graphics  grDevices methods   base

Regards,
Yihui
--
Yihui Xie <xieyihui at gmail.com>
Phone: 515-294-6609 Web: http://yihui.name
Department of Statistics, Iowa State University
3211 Snedecor Hall, Ames, IA




More information about the R-help mailing list