[Rcpp-commits] r3626 - pkg/Rcpp/inst/unitTests/testRcppClass/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon May 28 17:30:08 CEST 2012


Author: edd
Date: 2012-05-28 17:30:08 +0200 (Mon, 28 May 2012)
New Revision: 3626

Modified:
   pkg/Rcpp/inst/unitTests/testRcppClass/R/load.R
Log:
whitespace / indentation


Modified: pkg/Rcpp/inst/unitTests/testRcppClass/R/load.R
===================================================================
--- pkg/Rcpp/inst/unitTests/testRcppClass/R/load.R	2012-05-26 18:12:56 UTC (rev 3625)
+++ pkg/Rcpp/inst/unitTests/testRcppClass/R/load.R	2012-05-28 15:30:08 UTC (rev 3626)
@@ -8,31 +8,31 @@
 ## some methods that use C++ methods
 evalqOnLoad({
     ##library(methods)
-     stdNumeric$methods(
-    getEl = function(i) {
-        i <- as.integer(i)
-        if(i < 1 || i > size())
-            NA_real_
-        else
-            at(i-1L)
-    },
-    setEl = function(i, value) {
-        value <- as.numeric(value)
-        if(length(value) != 1)
-            stop("Only assigns single values")
-        i <- as.integer(i)
-        if(i < 1 || i > size())
-            stop("index out of bounds")
-        else
-            set(i-1L, value)
-    },
-    initialize = function(data = numeric()) {
-        callSuper()
-        data <- as.double(data)
-        n <- as.integer(max(50, length(data) * 2))
-        reserve(n)
-        assign(data)
-    }
+    stdNumeric$methods(
+        getEl = function(i) {
+            i <- as.integer(i)
+            if(i < 1 || i > size())
+                NA_real_
+            else
+                at(i-1L)
+        },
+        setEl = function(i, value) {
+            value <- as.numeric(value)
+            if(length(value) != 1)
+                stop("Only assigns single values")
+            i <- as.integer(i)
+            if(i < 1 || i > size())
+                stop("index out of bounds")
+            else
+                set(i-1L, value)
+        },
+        initialize = function(data = numeric()) {
+            callSuper()
+            data <- as.double(data)
+            n <- as.integer(max(50, length(data) * 2))
+            reserve(n)
+            assign(data)
+        }
     )
 })
 



More information about the Rcpp-commits mailing list