Browse code

listLen() is just lengths()

Martin Morgan authored on 19/11/2019 13:41:27
Showing 3 changed files

... ...
@@ -85,7 +85,7 @@ multiassign <- function (x, value, envir = parent.frame(), inherits = FALSE) {
85 85
 #### Functions for lists and environments
86 86
 
87 87
 listLen <- function(x)
88
-   .Call("listLen", x, PACKAGE="Biobase")
88
+    lengths(x)
89 89
 
90 90
 
91 91
 .new_env_size <- function(n) {
... ...
@@ -5,7 +5,6 @@
5 5
 SEXP anyMissing(SEXP);
6 6
 SEXP copyEnv(SEXP e1, SEXP e2, SEXP all);
7 7
 SEXP listToEnv(SEXP, SEXP);
8
-SEXP listLen(SEXP);
9 8
 SEXP rowQ(SEXP, SEXP);
10 9
 SEXP rowMedians(SEXP, SEXP, SEXP, SEXP);
11 10
 SEXP rowQuantiles(SEXP, SEXP);
... ...
@@ -22,7 +21,6 @@ __declspec(dllexport)
22 21
         {"anyMissing", (DL_FUNC)&anyMissing, 1},
23 22
         {"copyEnv", (DL_FUNC)&copyEnv, 3},
24 23
         {"listToEnv", (DL_FUNC)&listToEnv, 2},
25
-        {"listLen", (DL_FUNC)&listLen, 1},
26 24
         {"rowQ", (DL_FUNC)&rowQ, 2},
27 25
         {"rowMedians", (DL_FUNC)&rowMedians, 4},
28 26
         {"unsafe_set_slot", (DL_FUNC)&unsafe_set_slot, 3},
... ...
@@ -11,23 +11,6 @@
11 11
 
12 12
 */
13 13
 
14
-SEXP listLen(SEXP x)
15
-{
16
-  SEXP ans;
17
-  int i;
18
-  int *lens;
19
-
20
-  if (!Rf_isNewList(x))
21
-      error("arg 'x' must be a 'list', not '%s'", type2char(TYPEOF(x)));
22
-
23
-  PROTECT(ans = allocVector(INTSXP, length(x)));
24
-  lens = INTEGER(ans);
25
-  for(i = 0; i < length(x); i++)
26
-    lens[i] = length(VECTOR_ELT(x, i));
27
-  UNPROTECT(1);
28
-  return(ans);
29
-}
30
-
31 14
 SEXP copyEnv(SEXP e1, SEXP e2, SEXP all)
32 15
 {
33 16
     SEXP nms, sym, val;