[Rcpp-commits] r2869 - in pkg/RcppBDT: . R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Jan 13 23:26:51 CET 2011
Author: edd
Date: 2011-01-13 23:26:51 +0100 (Thu, 13 Jan 2011)
New Revision: 2869
Removed:
pkg/RcppBDT/R/methods.R
Modified:
pkg/RcppBDT/ChangeLog
pkg/RcppBDT/R/zzz.R
Log:
define methods in onLoad()
Modified: pkg/RcppBDT/ChangeLog
===================================================================
--- pkg/RcppBDT/ChangeLog 2011-01-13 22:12:38 UTC (rev 2868)
+++ pkg/RcppBDT/ChangeLog 2011-01-13 22:26:51 UTC (rev 2869)
@@ -1,6 +1,6 @@
2011-01-13 Dirk Eddelbuettel <edd at debian.org>
- * R/methods.R: added print and format methods
+ * R/zzz.R: added print and format methods
* man/bdt.Rd: documented print and format methods
2011-01-12 Dirk Eddelbuettel <edd at debian.org>
Deleted: pkg/RcppBDT/R/methods.R
===================================================================
--- pkg/RcppBDT/R/methods.R 2011-01-13 22:12:38 UTC (rev 2868)
+++ pkg/RcppBDT/R/methods.R 2011-01-13 22:26:51 UTC (rev 2869)
@@ -1,23 +0,0 @@
-##
-## bdt.R: Some accessor functions for Boost Date_Time functionality
-##
-## Copyright (C) 2010 - 2011 Dirk Eddelbuettel and Romain Francois
-##
-## This file is part of RcppBDT.
-##
-## RcppBDT is free software: you can redistribute it and/or modify it
-## under the terms of the GNU General Public License as published by
-## the Free Software Foundation, either version 2 of the License, or
-## (at your option) any later version.
-##
-## RcppBDT is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-## GNU General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with RcppBDT. If not, see <http://www.gnu.org/licenses/>.
-
-setMethod("print", "Rcpp_date", function(x, ...) print(x$getDate(), ...))
-
-setMethod("format", "Rcpp_date", function(x, ...) format(x$getDate(), ...))
Modified: pkg/RcppBDT/R/zzz.R
===================================================================
--- pkg/RcppBDT/R/zzz.R 2011-01-13 22:12:38 UTC (rev 2868)
+++ pkg/RcppBDT/R/zzz.R 2011-01-13 22:26:51 UTC (rev 2869)
@@ -38,6 +38,10 @@
bdt$setFromUTC() # but set a default value
assign("bdt", bdt, .NAMESPACE) # assign the reference instance
assign("bdtMod", bdtMod, .NAMESPACE) # and the module
+
+ setMethod("print", "Rcpp_date", function(x, ...) print(x$getDate(), ...))
+ setMethod("format", "Rcpp_date", function(x, ...) format(x$getDate(), ...))
+
lockBinding( "bdt", .NAMESPACE) # and lock
}
More information about the Rcpp-commits
mailing list