[Rcpp-commits] r4393 - in pkg/RcppXts: . man tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Jul 14 12:00:52 CEST 2013


Author: edd
Date: 2013-07-14 12:00:52 +0200 (Sun, 14 Jul 2013)
New Revision: 4393

Modified:
   pkg/RcppXts/ChangeLog
   pkg/RcppXts/DESCRIPTION
   pkg/RcppXts/man/RcppXts-package.Rd
   pkg/RcppXts/tests/checks.R
Log:
added some documentation
edited basic checks.R scripts


Modified: pkg/RcppXts/ChangeLog
===================================================================
--- pkg/RcppXts/ChangeLog	2013-07-13 00:41:34 UTC (rev 4392)
+++ pkg/RcppXts/ChangeLog	2013-07-14 10:00:52 UTC (rev 4393)
@@ -1,3 +1,7 @@
+2013-07-12  Dirk Eddelbuettel  <edd at debian.org>
+
+	* man/RcppXts-package.Rd: Added some documentation for new functions
+
 2013-06-26  Dirk Eddelbuettel  <edd at debian.org>
 
 	* src/xtsMod.cpp: Added a more functions now that xts 0.9-5 is on CRAN

Modified: pkg/RcppXts/DESCRIPTION
===================================================================
--- pkg/RcppXts/DESCRIPTION	2013-07-13 00:41:34 UTC (rev 4392)
+++ pkg/RcppXts/DESCRIPTION	2013-07-14 10:00:52 UTC (rev 4393)
@@ -1,7 +1,7 @@
 Package: RcppXts
 Type: Package
 Title: Interface the xts API via Rcpp
-Version: 0.0.4
+Version: 0.0.4.1
 Date: $Date$
 Author: Dirk Eddelbuettel
 Maintainer: Dirk Eddelbuettel <edd at debian.org>

Modified: pkg/RcppXts/man/RcppXts-package.Rd
===================================================================
--- pkg/RcppXts/man/RcppXts-package.Rd	2013-07-13 00:41:34 UTC (rev 4392)
+++ pkg/RcppXts/man/RcppXts-package.Rd	2013-07-14 10:00:52 UTC (rev 4393)
@@ -8,6 +8,11 @@
 \alias{xtsRbind}
 \alias{xtsCoredata}
 \alias{xtsLag}
+\alias{xtsEndpoints}
+\alias{xtsMakeIndexUnique}
+\alias{xtsMakeUnique}
+\alias{xtsMerge}
+\alias{xtsNaOmit}
 \docType{package}
 \title{Interface to the C API of xts}
 \description{This package helps with an Rcpp-based interface to the API
@@ -20,6 +25,11 @@
   xtsRbind(x, y, dup)
   xtsCoredata(x)
   xtsLag(x, k, pad)
+  xtsEndpoints(x, on, k, addlast)
+  xtsMakeIndexUnique(x, eps)
+  xtsMakeUnique(x, eps)
+  xtsMerge(x, y, all, fill, retclass, colnames, suffixes, retside, env, coerce)
+  xtsNaOmit(x)
 }
 \arguments{
   \item{x}{an \code{xts} object}
@@ -28,9 +38,29 @@
   \item{strictly}{a boolean switch}
   \item{check}{a boolean switch}
   \item{dup}{a boolean switch whether to remove duplicates}
-  \item{k}{an integer denoting lag length}
+  \item{k}{an integer denoting lag length, or interval}
   \item{pad}{a boolean switch whether to pad}
+
+  \item{on}{a numeric value for desired distance, measure in seconds, between endpoints}
+  \item{addlast}{a boolean switch whether last value should be included}
+  \item{eps}{a numeric value for the desired minimal difference between elements}
+  \item{all}{a boolean vector with two elements indication whether left
+    or right joins are desired}
+  \item{fill}{a vector with value to be filled at the end, if needed;
+    defaults to \code{NA}}
+  \item{retclass}{a boolean switch indicating whether the return class
+    attribute should be set; default is TRUE}
+  \item{colnames}{a character vector with column names}
+  \item{suffixes}{a character vector with column name suffixes; default is NULL}
+  \item{retside}{a boolean switch of size two for the desired return
+    dimension if these need to be set}
+  \item{env}{an environment, possibly empty}
+  \item{coerce}{an integer value indicating if coercion should be forced}
 }
+\details{Please use the \pkg{xts} sources as the ultimate reference for
+  these variables. The R functions in package \pkg{xts} set some of
+  these values up, and the \pkg{RcppXts} package could eventually shadow
+  some of this.}
 \author{Dirk Eddelbuettel}
 \keyword{package}
 \seealso{\code{\link[xts:xts-package]{xts}}}

Modified: pkg/RcppXts/tests/checks.R
===================================================================
--- pkg/RcppXts/tests/checks.R	2013-07-13 00:41:34 UTC (rev 4392)
+++ pkg/RcppXts/tests/checks.R	2013-07-14 10:00:52 UTC (rev 4393)
@@ -1,4 +1,8 @@
 
+## The function calls just validate that by going via RcppXts to xts, we still obtain
+## the same xts functionality.  The main purpose of this package is still to access xts
+## functionality while at the C++ layer.
+
 library(RcppXts)
 
 options("digits.secs"=6)
@@ -31,12 +35,19 @@
 xtsEndpoints(index(X), 60L, 4, TRUE)     # every fourth minute, incl last
 xtsEndpoints(index(X), 60L, 4, FALSE)    # every fourth minute
 
-xtsMerge(X, X2, c(TRUE,TRUE), TRUE, TRUE, "a", "b", TRUE, new.env(), 0)
+#stop("now")
+#xtsMerge(X, X2, c(TRUE,TRUE), TRUE, TRUE, "a", "b", TRUE, new.env(), 0)
+Y <- 2*X
+#index(Y) <- index(Y) + runif(length(X)) * 0.01
+#xtsMerge(X, Y, c(TRUE,TRUE), TRUE, TRUE, "a", "b", TRUE, new.env(), 0)
 
-Y2 <- Y
+Y2 <- Y[1:10]
 Y2[2] <- NA
 xtsNaOmit(Y2)
 
+xtsMerge(X, X, c(TRUE,TRUE), TRUE, TRUE, c("a", "b"), NULL, TRUE, new.env(), 0)
+
+
 ## -- requires xts 0.9-6 (fixed in SVN)
 ## Y2 <- X2
 ## Y2[3] <- NA



More information about the Rcpp-commits mailing list