[Eventstudies-commits] r140 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Aug 25 00:48:17 CEST 2013


Author: chiraganand
Date: 2013-08-25 00:48:14 +0200 (Sun, 25 Aug 2013)
New Revision: 140

Modified:
   pkg/R/AMM.R
Log:
Fixed global variables, defined them in the function environment itself.

Modified: pkg/R/AMM.R
===================================================================
--- pkg/R/AMM.R	2013-08-24 15:39:20 UTC (rev 139)
+++ pkg/R/AMM.R	2013-08-24 22:48:14 UTC (rev 140)
@@ -6,15 +6,19 @@
 ##########################
 
 AMM <- function(...) {
-
+  firm.returns <- NULL
+  market.returns <- NULL
+  others <- NULL
+  switch.to.innov <- NULL
+  market.returns.purge <- NULL
                                         # extract the arguments for
                                         # the model and load into the
                                         # current (function's)
                                         # environment
   modelArgs <- list(...)
-  list2env(list(...), envir = environment())
+  list2env(list(...))
 
-                                      # Checking required arguments
+                                        # Checking required arguments
   if (match("market.returns", names(modelArgs), nomatch = -1) == -1) {
     stop("Input market.returns (stock market index) is missing")
   }



More information about the Eventstudies-commits mailing list