[Returnanalytics-commits] r3361 - pkg/FactorAnalytics/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Apr 10 20:42:12 CEST 2014
Author: chenyian
Date: 2014-04-10 20:42:11 +0200 (Thu, 10 Apr 2014)
New Revision: 3361
Modified:
pkg/FactorAnalytics/R/fitFundamentalFactorModel.R
Log:
correct typo in fitFundamentalFactorModel.R
Modified: pkg/FactorAnalytics/R/fitFundamentalFactorModel.R
===================================================================
--- pkg/FactorAnalytics/R/fitFundamentalFactorModel.R 2014-04-10 18:42:03 UTC (rev 3360)
+++ pkg/FactorAnalytics/R/fitFundamentalFactorModel.R 2014-04-10 18:42:11 UTC (rev 3361)
@@ -180,6 +180,9 @@
}
if (standardized.factor.exposure == TRUE) {
+ if (is.na(weight.var)) {
+ stop("Need to assign weight variable")
+ }
weight = by(data = data, INDICES = as.numeric(data[[datevar]]),
function(x) x[[weight.var]]/sum(x[[weight.var]]))
data[[weight.var]] <- unlist(weight)
More information about the Returnanalytics-commits
mailing list