Skip to content

Commit

Permalink
clean up error message statement
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinMShea committed Aug 22, 2021
1 parent a79c0c3 commit 87ad2dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions R/fitTsfm.R
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ fitTsfm <- function(asset.names, factor.names, mkt.name=NULL, rf.name=NULL,
}
if (length(grep(" ", colnames(data))) > 0) {
stop("Please use syntactically valid column names for continuity with merge.xts.
See 'make.names' function and associated documentation. Also, this conversation:
https://stackoverflow.com/questions/9195718/variable-name-restrictions-in-r")
See 'make.names' function and associated documentation as well as
https://stackoverflow.com/questions/9195718/variable-name-restrictions-in-r")
}

# extract arguments to pass to different fit and variable selection functions
Expand All @@ -192,7 +192,7 @@ fitTsfm <- function(asset.names, factor.names, mkt.name=NULL, rf.name=NULL,

m2 <- match(names(as.list(args(lmrobdet.control ))), names(control), 0L)

lmrobdetMM.args <- do.call(lmrobdet.control,control[m2, drop=TRUE])
lmrobdetMM.args <- do.call(lmrobdet.control, control[m2, drop=TRUE])

m3 <- match(c("scope","scale","direction","trace","steps","k"),
names(control), 0L)
Expand Down
7 changes: 5 additions & 2 deletions R/fitTsfmUpDn.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,10 @@
#' colnames(managers)
#'
#' # example: Up and down market factor model with LS fit
#' fitUpDn <- fitTsfmUpDn(asset.names=colnames(managers[,(1:6)]),mkt.name="SP500.TR",
#' data=managers, fit.method="LS",control=NULL)
#' fitUpDn <- fitTsfmUpDn(asset.names = colnames(managers[,(1:6)]),
#' mkt.name = "SP500.TR",
#' data = managers,
#' fit.method = "LS")
#'
#' print(fitUpDn)
#' summary(fitUpDn)
Expand Down Expand Up @@ -122,6 +124,7 @@ fitTsfmUpDn <- function(asset.names, mkt.name, rf.name=NULL,
Rf = data.xts[ ,rf.name])
colnames(dat.xts) <- dat.xts.names
}

mkt <- dat.xts[ ,mkt.name]
# up market
dataUp.xts <- dat.xts[mkt >= 0]
Expand Down

0 comments on commit 87ad2dc

Please sign in to comment.