Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
On 9/2/14, 11:45 AM, "Steven Yen" <syen04 at gmail.com> wrote:
>Is there a way to over-write a procedure (subroutine)?
>
>I include a default procedure fixx in a list of procedures which are
>compiled into a package. By default, the procedure deliver the data
>matrix x.
>
>fixx <- function(x){
>result <- list(x=x)
>return(result)
>}
>
>In some applications, I have transformations (such as squared terms)
>in some column(s) in x. So I include the following procedure in the
>mail (calling) program, hoping to over-write the default procedure
>under the same name in the package (which is the way other languages
>works, e.g., Gauss):
>
>fixx <- function(x){
>x[,6]<-x[,5]^2/10
>result <- list(x=x)
>return(result)
>}
>
>This does not seem to work. The procedure in the main (calling)
>program seems to get ignored. Any idea? Thanks.
>
>______________________________________________
>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.