[Uwgarp-commits] r207 - in pkg/GARPFRM: R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Jul 23 04:31:13 CEST 2014
Author: tfillebeen
Date: 2014-07-23 04:31:11 +0200 (Wed, 23 Jul 2014)
New Revision: 207
Modified:
pkg/GARPFRM/R/riskMetricsAndHedges.R
pkg/GARPFRM/man/PCA.Rd
Log:
example taken out: not necessary
Modified: pkg/GARPFRM/R/riskMetricsAndHedges.R
===================================================================
--- pkg/GARPFRM/R/riskMetricsAndHedges.R 2014-07-18 00:23:18 UTC (rev 206)
+++ pkg/GARPFRM/R/riskMetricsAndHedges.R 2014-07-23 02:31:11 UTC (rev 207)
@@ -163,20 +163,12 @@
#' @param data time series data
#' @param nfactors number of components to extract
#' @param rotate "none", "varimax", "quatimax", "promax", "oblimin", "simplimax", and "cluster" are possible rotations/transformations of the solution.
-#'@examples
-#' library(psych)
-#' library(GPArotation)
-#' data(crsp.short)
-#' data = largecap.ts[,2:6]
-#' pca = PCA(data, nfactors = 3, rotate="none")
-#' # Retrieve Loadings and if loading is insignificant then omit
-#' getLoadings(pca)
-#' # Retrieve Weights
-#' getWeights(pca)
#' @return pca object loadings
#' @author Thomas Fillebeen
#' @export
PCA <- function(data, nfactors, rotate = "none"){
+ stopifnot("package:psych" %in% search() || require("psych", quietly = TRUE))
+
pca = principal(data, nfactors, rotate="none")
class(pca) <- c("PCA","psych", "principal")
return(pca)
Modified: pkg/GARPFRM/man/PCA.Rd
===================================================================
--- pkg/GARPFRM/man/PCA.Rd 2014-07-18 00:23:18 UTC (rev 206)
+++ pkg/GARPFRM/man/PCA.Rd 2014-07-23 02:31:11 UTC (rev 207)
@@ -19,17 +19,6 @@
This function estimates the delta for hedging a particular bond
given bond data
}
-\examples{
-library(psych)
-library(GPArotation)
-data(crsp.short)
-data = largecap.ts[,2:6]
-pca = PCA(data, nfactors = 3, rotate="none")
-# Retrieve Loadings and if loading is insignificant then omit
-getLoadings(pca)
-# Retrieve Weights
-getWeights(pca)
-}
\author{
Thomas Fillebeen
}
More information about the Uwgarp-commits
mailing list