[R] How to see any R package code?
Zhijiang Wang
ivorytower at emails.bjut.edu.cn
Fri Nov 6 10:28:16 CET 2009
Thank you Jim!
The problem is solved now.
Jim Lemon åé:
On 11/06/2009 02:24 AM, Zhijiang Wang wrote:
Dear All,
I have modified a .R code
(/usr/local/lib/R/site-library/brainwaver/R), but
when I run it, why does it run the original code? Whatever I modified
it,
the results did not change.
what happened?
Hi Zhijiang,
If you modify a source code file in an external editor, you must save the
result, then use:
source("usr/local/lib/R/site-library/brainwaver/R/mycode.R")
where "mycode.R" is the name of the file that you have modified. The code
that you "source" will replace the previous code. It looks like you are
modifying the code of one or more functions in the brainwaver package, so
when you have the function working as you wish, you will probably want to
rebuild the package, perhaps renaming it to something like brainwaver2.
See "Writing R extensions" (R-exts.html) for information on how to do
this. You would then be able to use:
library(brainwaver2)
instead of the original library.
Jim
--
Best wishes,
Zhijiang Wang
--------------------------------------------
PHD Student
Room 212, Science buliding,
The International WIC Institute,
College of Computer Science and Technology,
Beijing University of Technology,
Beijing, China.
More information about the R-help
mailing list