← all packages

zoo

native: 5 functions analysed · 1 typed · 2 untypeable · 1 timed out · 0 entry points (0 typed) · R: 313 definitions, 40 typed strict, 223 gradual, prelude debt 117 · fuzzing: 40 definitions, 1 unsound, 28 accept calls outside their domain · tyr dc7f1a7 · Rsem 7bcb45f · NativeSem 770a1eb · rstt 2b2696f unpinned

Native functions

C functions (no entry point, so all of them)
5 / 5 (100.0%)
typed
1 / 5 (20.0%)
1 more bound at their declared C signature after inference failed.

Native → R

No .Call/.C/.Fortran/.External site in the R code, so no entry point.

R definitions

named top-level definitions
313 / 313 (100.0%)
not blocked by an unbound native symbol
313 / 313 (100.0%)
typed, gradual
223 / 313 (71.2%)
typed, strict
40 / 313 (12.8%)
117 of the strict failures are a name missing from the prelude.
side
mode
318 / 318

Native functions 5

SymbolShortcuts typed

() -> ()
timing: 0.010 s
source
static void SymbolShortcuts(void)
{
  zoo_symbol_index = install("index");
  zoo_symbol_oclass = install("oclass");
  zoo_symbol_frequency = install("frequency");
  zoo_symbol_timeDate_format = install("format");
  zoo_symbol_timeDate_Data = install("Data");
  zoo_symbol_timeDate_FinCenter = install("FinCenter");
}
/__w/r-typing/r-typing/work/sources/zoo/src/init.c:50

R_init_zoo C signature

[*any] --> c_void
unbound variable
error detail
name: R_RegisterCCallable
timing: 0.006 s
source
void R_init_zoo(DllInfo *info)
{
  SymbolShortcuts();
  R_registerRoutines(info,
                     NULL,
                     callMethods,
                     NULL,
                     NULL);

  R_useDynamicSymbols(info, FALSE);
#define RegisterZoo(routine) R_RegisterCCallable("zoo",#routine,(DL_FUNC) &routine)

  /* used by external packages linking to internal xts code from C */
  R_RegisterCCallable("zoo","zoo_lag",(DL_FUNC) &zoo_lag);
  R_RegisterCCallable("zoo","zoo_coredata",(DL_FUNC) &zoo_coredata);
}
/__w/r-typing/r-typing/work/sources/zoo/src/init.c:60

zoo_lag untypeable

untypeable application
error detail
function: [c_int] --> c(0..)
argument: [c_int_na]
timing: 0.280 s
source
SEXP zoo_lag (SEXP x, SEXP _k, SEXP _pad)
{
#ifdef ZOO_DEBUG
Rprintf("zoo_lag\n");
#endif
  SEXP result;
  R_xlen_t i,j;

  int k = asInteger(_k) * -1; /* -1 is zoo convention */
  R_xlen_t nr = nrows(x);
  R_xlen_t nc = ncols(x);
  int P=0;
  int PAD = asInteger(_pad);

  R_xlen_t k_abs = abs(k);                     /* magnitude of the lag */
  R_xlen_t k_src = (k > 0) ? 0 : k_abs;        /* offset into x, "nrr stride" units */
  R_xlen_t k_dst = (k > 0 && PAD) ? k_abs : 0; /* offset into result */
  R_xlen_t k_pad = (k > 0) ? 0 : (nr - k_abs); /* where NA/pad values start */

  if(k_abs > nr)
    error("abs(k) must be less than nrow(x)");

  PROTECT(result = allocVector(TYPEOF(x), 
          xlength(x) - (PAD ? 0 : abs(k)*nc))); P++;

  R_xlen_t nrr;
  if(xlength(result) > 0)
    nrr = (R_xlen_t)(xlength(result)/nc);
  else  /* handle zero-length objects */
    nrr = nr - (PAD ? 0 : k_abs);
  R_xlen_t n_copy = nr - k_abs;

  switch (TYPEOF(x)) {
      case REALSXP:
          for (j = 0; j < nc; j++) {
              if (PAD) {
                  for (i = 0; i < k_abs; i++) {
                      REAL(result)[k_pad+i+(j*nrr)] = NA_REAL;
                  }
              }
              memcpy(&REAL(result)[k_dst+(j*nrr)], &REAL(x)[k_src+(j*nr)], sizeof(double) * n_copy);
          }
          break;
      case INTSXP:
          for (j = 0; j < nc; j++) {
              if (PAD) {
                  for (i = 0; i < k_abs; i++) {
                      INTEGER(result)[k_pad+i+(j*nrr)] = NA_INTEGER;
                  }
              }
              memcpy(&INTEGER(result)[k_dst+(j*nrr)], &INTEGER(x)[k_src+(j*nr)], sizeof(int) * n_copy);
          }
          break;
      case LGLSXP:
          for (j = 0; j < nc; j++) {
              if (PAD) {
                  for (i = 0; i < k_abs; i++) {
                      LOGICAL(result)[k_pad+i+(j*nrr)] = NA_LOGICAL;
                  }
              }
              memcpy(&LOGICAL(result)[k_dst+(j*nrr)], &LOGICAL(x)[k_src+(j*nr)], sizeof(int) * n_copy);
          }
          break;
      case CPLXSXP:
          for (j = 0; j < nc; j++) {
              if (PAD) {
                  for (i = 0; i < k_abs; i++) {
                      COMPLEX(result)[k_pad+i+(j*nrr)].r = NA_REAL;
                      COMPLEX(result)[k_pad+i+(j*nrr)].i = NA_REAL;
                  }
              }
              memcpy(&COMPLEX(result)[k_dst+(j*nrr)], &COMPLEX(x)[k_src+(j*nr)], sizeof(Rcomplex) * n_copy);
          }
          break;
      case RAWSXP:
          for(j = 0; j < nc; j++) {
              if (PAD) {
                  for (i = 0; i < k_abs; i++) {
                      RAW(result)[k_pad+i+(j*nrr)] = (Rbyte)0;
                  }
              }
              memcpy(&RAW(result)[k_dst+(j*nrr)], &RAW(x)[k_src+(j*nr)], sizeof(Rbyte) * n_copy);
          }
          break;
      case STRSXP:
          for(j = 0; j < nc; j++) {
              if (PAD) {
                  for (i = 0; i < k_abs; i++) {
                      SET_STRING_ELT(result, k_pad+i+(j*nrr), NA_STRING);
                  }
              }
              for(i = 0; i < n_copy; i++) {
                  SET_STRING_ELT(result, k_dst+i+(j*nrr), STRING_ELT(x, k_src+i+(j*nr)));
              }
          }
          break;
      default:
          error("unsupported type");
          break;
  }

  copyMostAttrib(x, result);  /* copy all attr *exept* names, dim, dimnames */
  if(!PAD) {
    /* need to shorten the index because the result was not padded with NA */
    SEXP idx_x    = PROTECT(getAttrib(x, zoo_symbol_index)); P++;
    SEXP idx_data = idx_x;
    if (isS4(idx_x)) {
      /* should make this
         1) generic for any S4 object if possible
         2) test for timeDate as this is important
      */
      SEXP idx_class = PROTECT(getAttrib(idx_x, R_ClassSymbol)); P++;
      if (STRING_ELT(idx_class, 0) != mkChar("timeDate"))
        error("'S4' objects must be of class 'timeDate'");
      idx_data = PROTECT(GET_SLOT(idx_x, zoo_symbol_timeDate_Data)); P++;
    }
    int idx_type = TYPEOF(idx_data);
    SEXP newindex = PROTECT(allocVector(idx_type, nrr)); P++;
    R_xlen_t k_idx = (k > 0) ? k_abs : 0;
    switch (idx_type) {
      case REALSXP:
        memcpy(REAL(newindex), &REAL(idx_data)[k_idx], nrr * sizeof(double));
        break;
      case INTSXP:
        memcpy(INTEGER(newindex), &INTEGER(idx_data)[k_idx], nrr * sizeof(int));
        break;
      default:
          error("unsupported index type");
        break;
    }
    if (isS4(idx_x)) {
      SEXP class = PROTECT(MAKE_CLASS("timeDate")); P++;
      SEXP timeDate = PROTECT(NEW_OBJECT(class)); P++;
      copyMostAttrib(idx_data, newindex);
      SET_SLOT(timeDate, zoo_symbol_timeDate_Data,newindex);
      SEXP format = PROTECT(GET_SLOT(idx_x, zoo_symbol_timeDate_format)); P++;
      SET_SLOT(timeDate, zoo_symbol_timeDate_format, format);
      SEXP finCenter = PROTECT(GET_SLOT(idx_x, zoo_symbol_timeDate_FinCenter)); P++;
      SET_SLOT(timeDate, zoo_symbol_timeDate_FinCenter, finCenter);
      setAttrib(result, zoo_symbol_index, timeDate);
    } else {
      copyMostAttrib(idx_data, newindex);
      setAttrib(result, zoo_symbol_index, newindex);
    }
  } 

  /* reset dims */
  if(!isNull(getAttrib(x, R_DimSymbol))) {
    SEXP dims;
    PROTECT(dims = allocVector(INTSXP, 2)); P++;
    INTEGER(dims)[0] = nrr;
    INTEGER(dims)[1] = nc;
    setAttrib(result, R_DimSymbol, dims); 
    setAttrib(result, R_DimNamesSymbol, getAttrib(x, R_DimNamesSymbol)); 
  }

  UNPROTECT(P);
  return result;
}
/__w/r-typing/r-typing/work/sources/zoo/src/lag.c:28

zoo_lagts untypeable

unbound variable
error detail
name: zoo_lag
timing: 0.025 s
source
SEXP zoo_lagts (SEXP x, SEXP _k, SEXP _pad) {
  int k_pos = asInteger(_k)*-1; /* change zoo default negative handling */
  SEXP k = PROTECT(ScalarInteger(k_pos));
  SEXP ans = zoo_lag (x, k, _pad);
  UNPROTECT(1);
  return ans;
}
/__w/r-typing/r-typing/work/sources/zoo/src/lag.c:188

zoo_coredata timeout

timing: 20.00 s
source
SEXP zoo_coredata (SEXP x, SEXP copyAttr)
{
  /* copyAttr is a LGLSXP flag to indicate whether all
     attributes are to be left intact.  This provides
     compatability with xts, by stripping all attributes
     if desired, without the overhead or adding then
     removing
  */
  SEXP result;
  R_xlen_t i, j, ncs, nrs;
  int P=0;
  PROTECT(result = allocVector(TYPEOF(x), xlength(x))); P++;
  switch( TYPEOF(x)) {
    case REALSXP:
      memcpy(REAL(result), REAL(x), xlength(result) * sizeof(double));
      break;
    case INTSXP:
      memcpy(INTEGER(result), INTEGER(x), xlength(result) * sizeof(int));
      break;
    case LGLSXP:
      memcpy(LOGICAL(result), LOGICAL(x), xlength(result) * sizeof(int));
      break;
    case CPLXSXP:
      memcpy(COMPLEX(result), COMPLEX(x), xlength(result) * sizeof(Rcomplex));
      break;
    case STRSXP:
      ncs = ncols(x); nrs = nrows(x);
      for(j=0; j< ncs; j++)
      for(i=0; i< nrs; i++)
        SET_STRING_ELT(result, i+j*nrs, STRING_ELT(x, i+j*nrs));
      break;
    case RAWSXP:
      memcpy(RAW(result), RAW(x), xlength(result) * sizeof(unsigned char));
      break;
    default:
      error("currently unsupported data type");
      break;
  }
  if( !isNull(getAttrib(x, R_DimSymbol))) {
    setAttrib(result, R_DimSymbol, getAttrib(x, R_DimSymbol));
    if( !isNull(getAttrib(x, R_DimNamesSymbol)) ) {  
      setAttrib(result, R_DimNamesSymbol, getAttrib(x,R_DimNamesSymbol));
    }
  } else {
    setAttrib(result, R_NamesSymbol, getAttrib(x, R_NamesSymbol));
  }
  if( asLogical(copyAttr)) {
    copyMostAttrib(x,result);
    SEXP oclass = PROTECT(getAttrib(x, zoo_symbol_oclass)); P++;
    setAttrib(result, R_ClassSymbol, oclass);
  }
  setAttrib(result, zoo_symbol_index,     R_NilValue);
  setAttrib(result, zoo_symbol_oclass,    R_NilValue);
  setAttrib(result, zoo_symbol_frequency, R_NilValue);

  UNPROTECT(P);
  return result;
}
/__w/r-typing/r-typing/work/sources/zoo/src/coredata.c:27

R definitions 313

R/as.Date.R

as.Date.numeric typed any: x accepts outside

(((x: <Date, ...>, origin: vec, ...: any) -> empty)&((x: any, origin: vec, ...: any) -> (DBL | INT)<difftime> | LGL<> | dbl<Date, ...> | <POSIXt, ...>)&((x: dbl | <Date, ...>, origin: vec, ...: any) -> date)&((x: dbl1 | <Date, ...>, origin: vec1, ...: any) -> date1))<>
timing: 0.715 s
fuzzing: 8 inside (5 ok, 3 error type) · 8 outside (7 rejected, 1 accepted)

Accepted outside the domain origin: 1

parameterchangecallreturned
originkind:nullas.Date.numeric(NA, "origin" = NULL, "fuzz_dot1" = new.env())(DBL & ~vec1)<Date> with { }

Other calls inside the domain

callverdicterror
as.Date.numeric("x" = raw(0), "origin" = logical(0), "fuzz_dot1" = function(...) quote(f(x)))error_typebase::+: non-numeric argument to binary operator
as.Date.numeric(NA, "origin" = as.raw(c(0)), "fuzz_dot1" = new.env())error_typebase::as.Date.default: do not know how to convert 'x' to class “Date”
as.Date.numeric(logical(0), 2147483647L, function(...) list(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p })))error_typebase::as.Date.default: do not know how to convert 'x' to class “Date”
source
as.Date.numeric <- function (x, origin, ...) {
  if (missing(origin)) origin <- "1970-01-01"
  if (identical(origin, "0000-00-00")) origin <- as.Date("0000-01-01", ...) - 1
  as.Date(origin, ...) + x
}
R/as.Date.R:7

as.Date untypeabletyped

unbound variable (line 3)
unbound: is.object — a name the prelude does not declare
error detail
name: is.object
gradual mode: typed
((x: ~(DBL | INT), ...: any) -> any)<>
timing: 0.089 s
source
as.Date <- function (x, ...) {
  ## for plain numeric input, call zoo:::as.Date.numeric
  if (!is.object(x) && is.numeric(x)) as.Date.numeric(x, ...)
  else UseMethod("as.Date")
}
R/as.Date.R:1

.as_Date_default typed accepts outside

(((x: vec, ...: any) -> date)&((x: vec1, ...: any) -> date1))<>
timing: 0.050 s
fuzzing: 8 inside (3 ok, 5 error type) · 8 outside (6 rejected, 2 accepted)

Accepted outside the domain x: 2

parameterchangecallreturned
xkind:null.as_Date_default("x" = NULL, "fuzz_dot1" = new.env())(DBL & ~vec1)<Date> with { }
xkind:null.as_Date_default(NULL)(DBL & ~vec1)<Date> with { }

Other calls inside the domain

callverdicterror
.as_Date_default("a")error_type::charToDate: character string is not in a standard unambiguous format
.as_Date_default("x" = NA_complex_)error_typebase::as.Date.default: do not know how to convert 'x' to class “Date”
.as_Date_default("NA", NULL, local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "fuzz_dot1" = as.name("x"))error_typebase::strptime: invalid 'format' argument
.as_Date_default("x" = as.raw(c(255)), "fuzz_dot1" = NA_character_, "fuzz_dot2" = as.name("x"))error_typebase::as.Date.default: do not know how to convert 'x' to class “Date”
.as_Date_default("x" = complex(0), "fuzz_dot1" = function(...) function(...) list(), "fuzz_dot2" = quote(f(x)))error_typebase::as.Date.default: do not know how to convert 'x' to class “Date”
source
.as_Date_default <- function(x, ...) base::as.Date(x, ...)
R/as.Date.R:13
R/MATCH.R

MATCH untypeabletyped

unbound variable (line 2)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, table: any, nomatch: any?, ...: any) -> any)<>
timing: 0.012 s
source
MATCH <- function(x, table, nomatch = NA, ...)
  UseMethod("MATCH")
R/MATCH.R:1

MATCH.default untypeable

unbound variable (line 5)
unbound: is.atomic — a name the prelude does not declare
error detail
name: is.atomic
timing: 0.085 s
source
MATCH.default <- function(x, table, nomatch = NA, ...) {
  if(is.atomic(x) && !is.object(x)) {
    if(inherits(table, "Date")) {
      x <- unclass(as.Date(x, origin = "1970-01-01"))
      table <- unclass(table)
    } else if(inherits(table, "POSIXt")) {
      x <- unclass(as.POSIXct(x, origin = "1970-01-01"))
      table <- unclass(as.POSIXct(table))
    }
  }
  match(x, table, nomatch = nomatch, ...)
}
R/MATCH.R:4

MATCH.timeDate untypeabletyped

unbound variable (line 18)
unbound: match — a name the prelude does not declare
error detail
name: match
gradual mode: typed
((x: vec, table: vec, nomatch: any?, ...: any) -> any)<>
timing: 0.133 s
source
MATCH.timeDate <- function(x, table, nomatch = NA, ...) {
  match(as.POSIXct(x), as.POSIXct(table), nomatch = nomatch, ...)
}
R/MATCH.R:17

MATCH.times untypeabletyped

unbound variable (line 22)
unbound: match — a name the prelude does not declare
error detail
name: match
gradual mode: typed
((x: dbl, table: dbl, nomatch: any?, units: any?, eps: any?, ...: any) -> any)<>
timing: 0.404 s
source
MATCH.times <- function(x, table, nomatch = NA, units = "sec", eps = 1e-10, ...) {
 match(trunc(x, units, eps), trunc(table, units, eps), nomatch = nomatch, ...)
}
R/MATCH.R:21

MATCH.Date untypeable

unbound variable (line 26)
unbound: as.Date — one of the package’s own names, itself untyped
error detail
name: as.Date
timing: 0.075 s
source
MATCH.Date <- function(x, table, nomatch = NA, ...) {
  if(!inherits(table, "Date")) table <- as.Date(table)
  match(unclass(x), unclass(table), nomatch = nomatch, ...)
}
R/MATCH.R:25

MATCH.POSIXct untypeabletyped

unbound variable (line 32)
unbound: match — a name the prelude does not declare
error detail
name: match
gradual mode: typed
((x: <...>, table: vec, nomatch: any?, ...: any) -> any)<>
timing: 0.320 s
source
MATCH.POSIXct <- function(x, table, nomatch = NA, ...) {
  if(!inherits(table, "POSIXct")) table <- as.POSIXct(table)
  match(unclass(x), unclass(table), nomatch = nomatch, ...)
}
R/MATCH.R:30

MATCH.POSIXlt untypeabletyped

unbound variable (line 38)
unbound: match — a name the prelude does not declare
error detail
name: match
gradual mode: typed
((x: vec, table: vec, nomatch: any?, ...: any) -> any)<>
timing: 0.568 s
source
MATCH.POSIXlt <- function(x, table, nomatch = NA, ...) {
  x <- as.POSIXct(x)
  if(!inherits(table, "POSIXct")) table <- as.POSIXct(table)
  match(unclass(x), unclass(table), nomatch = nomatch, ...)
}
R/MATCH.R:35
R/ORDER.R

ORDER untypeabletyped

unbound variable (line 2)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.003 s
source
ORDER <- function(x, ...)
  UseMethod("ORDER")
R/ORDER.R:1

ORDER.default skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
ORDER.default <- function(x, ..., na.last = TRUE, decreasing = FALSE)
  order(x, ..., na.last = na.last, decreasing = decreasing)
R/ORDER.R:4

ORDER.timeDate untypeabletyped

unbound variable (line 8)
unbound: order — a name the prelude does not declare
error detail
name: order
gradual mode: typed
((x: vec, ...: any) -> any)<>
timing: 0.022 s
source
ORDER.timeDate <- function(x, ...) {
  order(as.POSIXct(x), ...)
}
R/ORDER.R:7

ORDER.chron untypeabletyped

unbound variable (line 12)
unbound: order — a name the prelude does not declare
error detail
name: order
gradual mode: typed
null
timing: 0.067 s
source
ORDER.chron <- ORDER.dates <- ORDER.times <- function(x, ...) {
  order(as.numeric(x), ...)
}
R/ORDER.R:11
R/coredata.R

coredata untypeabletyped

unbound variable (line 2)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.004 s
source
coredata <- function(x, ...)
  UseMethod("coredata")
R/coredata.R:1

coredata.default typed fuzz ok

∀'a. ((x: 'a, ...: any) -> 'a)<>
timing: 0.009 s
fuzzing: 20 inside (20 ok) · 8 outside (8 rejected)
type drawn from: ((x: 'x, ...: any) -> 'x)<>
source
coredata.default <- function(x, ...) x
R/coredata.R:4

coredata.zoo untypeabletyped

unbound variable (line 8)
unbound: attr<- — a name the prelude does not declare
error detail
name: attr<-
gradual mode: typed
((x: any with { oclass: any, any }, ...: any) -> any)<>
timing: 0.022 s
source
coredata.zoo <- function(x, ...)
{
  attr(x, "class") <- attr(x, "oclass")
  attr(x, "index") <- attr(x, "oclass") <- attr(x, "frequency") <- NULL
  return(x)
}
R/coredata.R:6

coredata.ts untypeabletyped

unbound variable (line 23)
unbound: attr<- — a name the prelude does not declare
error detail
name: attr<-
gradual mode: typed
((x: <...>, ...: any) -> any)<>
timing: 0.013 s
source
coredata.ts <- function(x, ...)
{
  x <- unclass(x)
  attr(x, "tsp") <- NULL
  return(x)
}
R/coredata.R:20

coredata.irts typed accepts outside

∀'a. ((x: { value: 'a, any }, ...: any) -> 'a)<>
timing: 0.039 s
fuzzing: 20 inside (20 ok) · 8 outside (6 rejected, 2 accepted)
type drawn from: ((x: { value: 'I1361, any }, ...: any) -> 'I1361)<>

Accepted outside the domain x: 2

parameterchangecallreturned
xdropcoredata.irts(NULL, as.name("x"))null
xkind:nullcoredata.irts("x" = NULL, "fuzz_dot1" = as.name("x"))null
source
coredata.irts <- function(x, ...)
{
  return(x$value)
}
R/coredata.R:27

coredata.its untypeabletyped

unbound variable (line 34)
unbound: @ — a name the prelude does not declare
error detail
name: @
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.005 s
source
coredata.its <- function(x, ...)
{
  return(x@.Data)
}
R/coredata.R:32

coredata<- untypeabletyped

unbound variable (line 40)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, value: any) -> any)<>
timing: 0.003 s
source
"coredata<-" <- function(x, value)
{
  UseMethod("coredata<-")
}
R/coredata.R:38

coredata<-.zoo untypeable

unbound variable (line 46)
unbound: is.vector — a name the prelude does not declare
error detail
name: is.vector
timing: 0.126 s
source
"coredata<-.zoo" <- function(x, value)
{
  stopifnot(length(x) == length(value))
  if(!(is.vector(value) || is.factor(value) || is.matrix(value) || is.data.frame(value)))
    stop(paste(dQuote("value"), ": attempt to assign invalid coredata to zoo object"))
  if(is.matrix(value) || is.data.frame(value)) value <- as.matrix(value)
    
  x[] <- value  
  attr(x, "oclass") <- attr(value, "class")
  return(x)
}
R/coredata.R:43

coredata<-.ts typed accepts outside

∀'a,'b,`a. (((x: v('a)<`a> with { dim: absent, any } | v('a)<`a> with { dim: null, any }, value: v('a)) -> v('a)<`a>)&((x: v('b)<`a> with { dim: dbl, any }, value: v('b)) -> v('b)<`a>))<>
timing: 0.729 s
fuzzing: 24 inside (5 ok, 19 error pkg) · 8 outside (6 rejected, 2 accepted)
type drawn from: (((x: v('I1544)<`I121> with { dim: absent, any } | v('I1544)<`I121> with { dim: null, any }, value: v('I1544)) -> v('I1544)<`I121>) & ((x: v('I1545)<`I121> with { dim: dbl, any }, value: v('I1545)) -> v('I1545)<`I121>))<>

Accepted outside the domain x: 2

parameterchangecallreturned
xwrapcoredata<-.ts(list(integer(0)), 2L){ 2L<> with { } }<> with { }
xwrapcoredata<-.ts("x" = list(structure(c(2147483647, -1), "dim" = c(2L, 1L))), "value" = 1000000){ 1000000.<> with { } }<> with { }

Other calls inside the domain

callverdicterror
coredata<-.ts(NA_character_, c("NA", "", NA_character_, "a", ""))error_pkgzoo::coredata<-.ts: length(x) == length(value) is not TRUE
coredata<-.ts(structure(character(0), "dim" = c(0L, 1L)), "value" = "NA")error_pkgzoo::coredata<-.ts: length(x) == length(value) is not TRUE
coredata<-.ts("x" = structure(as.raw(c(255)), "dim" = c(1L, 1L)), "value" = as.raw(c(0, 0)))error_pkgzoo::coredata<-.ts: length(x) == length(value) is not TRUE
coredata<-.ts(integer(0), 2L)error_pkgzoo::coredata<-.ts: length(x) == length(value) is not TRUE
coredata<-.ts("x" = structure(0, "dim" = c(1L, 1L)), "value" = c(Inf, 2))error_pkgzoo::coredata<-.ts: length(x) == length(value) is not TRUE
coredata<-.ts("x" = logical(0), "value" = c(FALSE, TRUE, FALSE, FALSE, FALSE))error_pkgzoo::coredata<-.ts: length(x) == length(value) is not TRUE
and 13 more
source
"coredata<-.ts" <- function(x, value)
{
  stopifnot(length(x) == length(value))
  dim(value) <- dim(x)
  x[] <- value
  return(x)
}
R/coredata.R:55

coredata<-.irts typed fuzz ok

∀'a,'b,`a,`b,`c. (((x: { value: v('a)<`a> with { dim: absent, any } | v('a)<`a> with { dim: null, any }, `c }<`b>, value: v('a)) -> { value: v('a)<`a>, `c }<`b>)&((x: { value: v('b)<`a> with { dim: dbl, any }, `c }<`b>, value: v('b)) -> { value: v('b)<`a>, `c }<`b>))<>
timing: 1.83 s
fuzzing: 26 inside (6 ok, 20 error pkg) · 8 outside (8 rejected)
type drawn from: (((x: { value: v('I1585)<`I129> with { dim: absent, any } | v('I1585)<`I129> with { dim: null, any }, `I131 }<`I130>, value: v('I1585)) -> { value: v('I1585)<`I129>, `I131 }<`I130>) & ((x: { value: v('I1586)<`I129> with { dim: dbl, any }, `I131 }<`I130>, value: v('I1586)) -> { value: v('I1586)<`I129>, `I131 }<`I130>))<>

Other calls inside the domain

callverdicterror
coredata<-.irts("x" = list("value" = TRUE, -1, as.name("x")), "value" = c(TRUE, NA))error_pkgzoo::coredata<-.irts: length(x$value) == length(value) is not TRUE
coredata<-.irts(list("value" = structure(as.raw(c(255, 0)), "dim" = c(2L, 1L)), as.raw(c(0)), c("", "a", "", "a", "é")), "value" = raw(0))error_pkgzoo::coredata<-.irts: length(x$value) == length(value) is not TRUE
coredata<-.irts("x" = list("value" = as.raw(c(0, 255, 255, 255, 0))), "value" = as.raw(c(255)))error_pkgzoo::coredata<-.irts: length(x$value) == length(value) is not TRUE
coredata<-.irts("x" = list("value" = c(NA, NA, NA, FALSE, FALSE)), "value" = logical(0))error_pkgzoo::coredata<-.irts: length(x$value) == length(value) is not TRUE
coredata<-.irts("x" = list("value" = c(2L, -2147483647L, -1L, 2147483647L, -1L), list(-2147483647L)), "value" = c(-1L, 2147483647L))error_pkgzoo::coredata<-.irts: length(x$value) == length(value) is not TRUE
coredata<-.irts(list("value" = structure(raw(0), "dim" = c(0L, 1L))), as.raw(c(255, 255, 255, 0, 0)))error_pkgzoo::coredata<-.irts: length(x$value) == length(value) is not TRUE
and 14 more
source
"coredata<-.irts" <- function(x, value)
{
  stopifnot(length(x$value) == length(value))
  dim(value) <- dim(x$value)
  x$value[] <- value
  return(x)
}
R/coredata.R:63

coredata<-.its untypeabletyped

unbound variable (line 73)
unbound: @ — a name the prelude does not declare
error detail
name: @
gradual mode: typed
((x: any, value: any) -> any)<>
timing: 0.016 s
source
"coredata<-.its" <- function(x, value)
{
  stopifnot(length(x@.Data) == length(value))
  dim(value) <- dim(x@.Data)
  x@.Data[] <- as.matrix(value)
  return(x)
}
R/coredata.R:71
R/index.R

index untypeabletyped

unbound variable (line 3)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.003 s
source
index <- function(x, ...)
{
  UseMethod("index")
}
R/index.R:1

index.default untypeabletyped

unbound variable (line 8)
unbound: NROW — a name the prelude does not declare
error detail
name: NROW
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.003 s
source
index.default <- function(x, ...)
{
  seq_len(NROW(x))
}
R/index.R:6

index.zoo typed accepts outside

∀'a. ((x: any with { index: 'a, any }, ...: any) -> 'a)<>
timing: 0.028 s
fuzzing: 20 inside (20 ok) · 8 outside (2 rejected, 6 accepted)
type drawn from: ((x: any with { index: 'I1638, any }, ...: any) -> 'I1638)<>

Accepted outside the domain x: 6

parameterchangecallreturned
xattr:drop:indexindex.zoo("x" = function(...) list(), "fuzz_dot1" = as.raw(c(255)), "fuzz_dot2" = 2L)null
xkind:listindex.zoo(list(), "fuzz_dot1" = new.env())null
xkind:symindex.zoo(as.name("x"), NULL)null
xwrapindex.zoo(list(structure(new.env(), "index" = c(complex(real = 0, imaginary = 0), NA_complex_))), character(0), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "fuzz_dot1" = NULL)null
xwrapindex.zoo(list(structure(as.raw(c(0, 255)), "index" = as.raw(c(255)))), as.raw(c(0, 255, 255, 0, 255)))null
xwrapindex.zoo(list(structure(new.env(), "index" = -1)), function(...) NULL, "fuzz_dot1" = NULL, "fuzz_dot2" = as.name("x"))null
source
index.zoo <- function(x, ...)
{
  attr(x, "index")
}
R/index.R:11

index.ts untypeabletyped

unbound variable (line 18)
unbound: tsp — a name the prelude does not declare
error detail
name: tsp
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.012 s
source
index.ts <- function(x, ...)
{
  xtsp <- tsp(x)
  seq(xtsp[1], xtsp[2], by = 1/xtsp[3])
}
R/index.R:16

time.zoo untypeabletyped

unbound variable (line 24)
unbound: index — one of the package’s own names, itself untyped
error detail
name: index
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.003 s
source
time.zoo <- function(x, ...)
{
  index(x)
}
R/index.R:22

index<- untypeabletyped

unbound variable (line 29)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, value: any) -> any)<>
timing: 0.004 s
source
"index<-" <- function(x, value) 
{
	UseMethod("index<-")
}
R/index.R:27

time<- untypeabletyped

unbound variable (line 34)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, value: any) -> any)<>
timing: 0.004 s
source
"time<-" <- function(x, value) 
{
	UseMethod("time<-")
}
R/index.R:32

index<-.zoo untypeabletyped

unbound variable (line 39)
unbound: index — one of the package’s own names, itself untyped
error detail
name: index
gradual mode: typed
((x: any, value: any) -> any)<>
timing: 0.011 s
source
"index<-.zoo" <- function(x, value) 
{
	if(length(index(x)) != length(value)) 
	  stop("length of index vectors does not match")
	if(is.unsorted(ORDER(value)))
	  stop("new index needs to be sorted")	
	attr(x, "index") <- value
	return(x)
}
R/index.R:37

time<-.zooreg untypeable

unbound variable (line 49)
unbound: index — one of the package’s own names, itself untyped
error detail
name: index
timing: 0.463 s
source
"time<-.zooreg" <- "index<-.zooreg" <- function(x, value) 
{
	if(length(index(x)) != length(value)) 
	  stop("length of index vectors does not match")
	if(is.unsorted(ORDER(value)))
	  stop("new index needs to be sorted")	

        ## check whether new index still conforms with
	## frequency, if not: drop frequency
        d <- try(diff(as.numeric(value)), silent = TRUE)
	ok <- if(inherits(d, "try-error") || length(d) < 1 || anyNA(d)) FALSE
	else {	    
            deltat <- min(d)
	    dd <- d/deltat
	    if(identical(all.equal(dd, round(dd)), TRUE)) {	    
                freq <- 1/deltat
                if(freq > 1 && identical(all.equal(freq, round(freq)), TRUE)) freq <- round(freq)
  	        identical(all.equal(attr(x, "frequency") %% freq, 0), TRUE)
	    } else {
	        FALSE
	    }
	}
	if(!ok) {
	  attr(x, "frequency") <- NULL
	  class(x) <- class(x)[-which(class(x) == "zooreg")]
	}
 	
	attr(x, "index") <- value
	return(x)
}
R/index.R:47

time<-.zoo untypeabletyped

unbound variable (line 80)
unbound: index — one of the package’s own names, itself untyped
error detail
name: index
gradual mode: typed
((x: any, value: any) -> any)<>
timing: 0.008 s
source
"time<-.zoo" <- function(x, value) 
{
	if(length(index(x)) != length(value)) 
	  stop("length of time vectors does not match")
	attr(x, "index") <- value
	return(x)
}
R/index.R:78

start.zoo untypeable

unbound variable (line 88)
unbound: index — one of the package’s own names, itself untyped
error detail
name: index
timing: 0.011 s
source
start.zoo <- function(x, ...) 
{
	if (length(index(x)) > 0) index(x)[1]
	  else NULL
}
R/index.R:86

end.zoo untypeable

unbound variable (line 94)
unbound: index — one of the package’s own names, itself untyped
error detail
name: index
timing: 0.015 s
source
end.zoo <- function(x, ...) 
{
	lx <- length(index(x))
	if (lx > 0) index(x)[lx]
	  else NULL
}
R/index.R:92
R/index2char.R

index2char untypeabletyped

unbound variable (line 1)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.003 s
source
index2char <- function(x, ...) UseMethod("index2char")
R/index2char.R:1

index2char.default typed accepts outside

(((x: vec | null, ...: any) -> CHR<>)&((x: vec1, ...: any) -> CHR1<>))<>
timing: 0.052 s
fuzzing: 8 inside (8 ok) · 8 outside (2 rejected, 6 accepted)

Accepted outside the domain x: 6

parameterchangecallreturned
xkind:listindex2char.default("x" = list(), "fuzz_dot1" = NULL)(CHR & ~vec1)<> with { }
xkind:listindex2char.default("x" = list())(CHR & ~vec1)<> with { }
xkind:symindex2char.default("x" = as.name("x"), "fuzz_dot1" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))"x"<> with { }
xkind:symindex2char.default(as.name("x"), "fuzz_dot1" = as.name("x"), "fuzz_dot2" = list(quote(f(x))))"x"<> with { }
xwrapindex2char.default(list("NA"), list(), as.name("x"), "fuzz_dot1" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "fuzz_dot2" = list())"NA"<> with { }
xwrapindex2char.default(list(c(2147483647L, 1000000L)), complex(0))"c(2147483647, 1000000)"<> with { }
source
index2char.default <- function(x, ...) as.character(x)
R/index2char.R:3

index2char.POSIXt typed any: x fuzz ok

(((x: any, ...: any) -> CHR<>)&((x: vec1, ...: any) -> CHR1<>))<>
timing: 0.041 s
fuzzing: 8 inside (7 ok, 1 error type) · 5 outside (5 rejected)

Other calls inside the domain

callverdicterror
index2char.POSIXt(NA, NULL, "fuzz_dot1" = Inf)error_typebase::prettyNum: invalid 'trim' argument
source
index2char.POSIXt <- function(x, ...) format(x, ...)
R/index2char.R:5

index2char.numeric typed any: x unsound

(((x: any, frequency: null?, digits: absent, ...: any) -> empty)&((x: dbl, frequency: null?, digits: dbl1?, ...: any) -> CHR<>)&((x: dbl1, frequency: null?, digits: dbl1?, ...: any) -> CHR1<>))<>
timing: 0.402 s
fuzzing: 8 inside (5 ok, 3 unsound) · 8 outside (6 rejected, 2 accepted)

Counterexamples

callpredictedreturned
index2char.numeric("x" = c(TRUE, NA), "frequency" = NULL, "fuzz_dot1" = NULL, "fuzz_dot2" = NULL)empty(CHR & ~vec1)<> with { }
index2char.numeric("x" = c(NaN, -2147483647, -1, 0, 1), "fuzz_dot1" = as.name("x"), "fuzz_dot2" = quote(f(x)))empty(CHR & ~vec1)<> with { }
index2char.numeric(c(42L, NA_integer_, -1L, 2L, 1000000L), NULL, "fuzz_dot1" = list(quote(f(x))))empty(CHR & ~vec1)<> with { }

Accepted outside the domain frequency: 2

parameterchangecallreturned
frequencykind:dblindex2char.numeric(c(42L, NA_integer_, -1L, 2L, 1000000L), 1.5, "fuzz_dot1" = list(quote(f(x))))(CHR & ~vec1)<> with { }
frequencywrapindex2char.numeric("x" = new.env(), "frequency" = list(NULL), "fuzz_dot1" = NULL)(CHR & ~vec1)<> with { }
source
index2char.numeric <- function(x, frequency = NULL, digits = getOption("digits") - 3, ...)
{
  freq <- frequency
  if(is.null(freq)) return(as.character(round(x, digits = digits)))
  if(length(x) < 1) return(character(0))
  d <- diff(x)
  if(freq > 1 && identical(all.equal(freq, round(freq)), TRUE)) freq <- round(freq)
  if(identical(all.equal(freq*d, round(freq*d)), TRUE)) {
    if(freq == 1) return(as.character(round(x)))
      else return(paste(floor(x), "(", round((x - floor(x)) * freq) + 1, ")", sep = ""))
  } else
    return(as.character(round(x, digits = digits)))
}
R/index2char.R:7
R/yearmon.R

yearmon typed fuzz ok

((x: dbl<~@"+", ~@"/", ...>) -> DBL)<>
timing: 0.381 s
fuzzing: 7 inside (5 ok, 2 error type) · 8 outside (8 rejected)

Other calls inside the domain

callverdicterror
yearmon(raw(0))error_typebase::*: non-numeric argument to binary operator
yearmon(as.raw(c(0, 0)))error_typebase::*: non-numeric argument to binary operator
source
yearmon <- function(x) structure(floor(12*x + .0001)/12, class = "yearmon")
R/yearmon.R:2

as.yearmon untypeabletyped

unbound variable (line 5)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.003 s
source
as.yearmon <- function(x, ...) UseMethod("as.yearmon")
R/yearmon.R:5

as.yearmon.default untypeabletyped

unbound variable (line 6)
unbound: as.yearmon — one of the package’s own names, itself untyped
error detail
name: as.yearmon
gradual mode: typed
((x: vec | null, ...: any) -> any)<>
timing: 0.020 s
source
as.yearmon.default <- function(x, ...) as.yearmon(as.numeric(x))
R/yearmon.R:6

as.yearmon.numeric typed fuzz ok

((x: dbl<~@"+", ~@"/", ...>, ...: any) -> DBL)<>
timing: 0.027 s
fuzzing: 8 inside (6 ok, 2 error type) · 8 outside (8 rejected)

Other calls inside the domain

callverdicterror
as.yearmon.numeric("x" = as.raw(c(255)))error_typebase::*: non-numeric argument to binary operator
as.yearmon.numeric(raw(0), "fuzz_dot1" = as.name("x"), "fuzz_dot2" = new.env())error_typebase::*: non-numeric argument to binary operator
source
as.yearmon.numeric <- function(x, ...) yearmon(x)
R/yearmon.R:7

as.yearmon.integer typed accepts outside

((x: vec | null, ...: any) -> DBL)<>
timing: 0.055 s
fuzzing: 7 inside (7 ok) · 8 outside (5 rejected, 3 accepted)

Accepted outside the domain x: 3

parameterchangecallreturned
xwrapas.yearmon.integer(list(FALSE))0.<yearmon> with { }
xwrapas.yearmon.integer("x" = list(logical(0)), "fuzz_dot1" = NULL)(DBL1 \ ^DBL1)<yearmon> with { }
xwrapas.yearmon.integer("x" = list(NA_character_))(DBL1 \ ^DBL1)<yearmon> with { }
source
as.yearmon.integer <- function(x, ...) structure(as.numeric(x), class = "yearmon")
R/yearmon.R:8

as.yearmon.yearqtr typed accepts outside

((x: vec | null, frac: 0?, ...: any) -> DBL)<>
gradual mode: typed
(((x: (CHR | CLX | LGL | RAW) | null, frac: any?, ...: any) -> any)&((x: vec | null, frac: 0?, ...: any) -> DBL))<>
timing: 0.140 s
fuzzing: 8 inside (8 ok) · 8 outside (5 rejected, 3 accepted)

Accepted outside the domain frac: 1, x: 2

parameterchangecallreturned
fracretype:int>chras.yearmon.yearqtr("x" = NA_character_, "frac" = "")(DBL1 \ ^DBL1)<yearmon> with { }
xwrapas.yearmon.yearqtr("x" = list("x y"))(DBL1 \ ^DBL1)<yearmon> with { }
xwrapas.yearmon.yearqtr("x" = list(integer(0)))(DBL1 \ ^DBL1)<yearmon> with { }
source
as.yearmon.yearqtr <- function(x, frac = 0, ...) {
    if (frac == 0) yearmon(as.numeric(x)) else
    as.yearmon(as.Date(x, frac = frac), ...)
}
R/yearmon.R:9

as.yearmon.dates untypeabletyped

unbound variable (line 15)
unbound: as.POSIXlt — a name the prelude does not declare
error detail
name: as.POSIXlt
gradual mode: typed
null
timing: 0.025 s
source
as.yearmon.dates <- 
as.yearmon.Date <- 
as.yearmon.POSIXt <- function(x, ...) as.yearmon(with(as.POSIXlt(x, tz="GMT"), 1900 + year + mon/12))
R/yearmon.R:13

as.yearmon.mondate untypeabletyped

unbound variable (line 19)
unbound: as.Date — one of the package’s own names, itself untyped
error detail
name: as.Date
gradual mode: typed
null
timing: 0.015 s
source
as.yearmon.mondate <-
as.yearmon.timeDate <-
as.yearmon.jul <- function(x, ...) as.yearmon(as.Date(x, ...))
R/yearmon.R:17

as.yearmon.factor untypeabletyped

unbound variable (line 20)
unbound: as.yearmon — one of the package’s own names, itself untyped
error detail
name: as.yearmon
gradual mode: typed
((x: vec | null, ...: any) -> any)<>
timing: 0.022 s
source
as.yearmon.factor <- function(x, ...) as.yearmon(as.character(x), ...)
R/yearmon.R:20

as.yearmon.character untypeabletyped

unbound variable (line 28)
unbound: na.omit — a name the prelude does not declare
error detail
name: na.omit
gradual mode: typed
((x: (CHR | CLX | LGL | RAW)<@"[", ...>, format: vec?, ...: any) | (x: (CHR | CLX | LGL | RAW)<~@"[", ...>, format: vec?, ...: any) -> any)<>
timing: 1.56 s
source
as.yearmon.character <- function(x, format = "", ...) {
    non.na <- x[!is.na(x)]
    if (length(non.na) == 0L) 
        return(structure(rep(NA_real_, length(x)), class = "yearmon"))
   if (format == "") {
        nch <- nchar(gsub("[^-]", "", x))
		nch[is.na(x)] <- NA
		nch <- na.omit(nch)
        if (length(table(nch)) != 1) 
            stop("yearmon variable can only have one format")
		format <- if (all(nch == 0)) "%B %Y"
		else if (all(nch == 1)) "%Y-%m" else "%Y-%m-%d"
   }
   has.short.keys <- rep(regexpr("%[mbByY%]", format) > 0, length(x))
   has.no.others <- regexpr("%", gsub("%[mbByY%]", "", format)) < 0
   z <- ifelse(has.short.keys & has.no.others,
      as.Date( paste("01", x, sep = "-"), paste("%d", format, sep = "-"), ... ),
      as.Date(x, format, ...))
   as.yearmon(as.Date(z, origin = "1970-01-01"))
}
R/yearmon.R:21

as.yearmon.ti untypeabletyped

unbound variable (line 41)
unbound: as.Date — one of the package’s own names, itself untyped
error detail
name: as.Date
gradual mode: typed
((x: ~(DBL | INT), ...: any) -> any)<>
timing: 0.004 s
source
as.yearmon.ti <- function(x, ...) as.yearmon(as.Date(x), ...)
R/yearmon.R:41

as.Date.yearmon untypeable

unbound variable (line 47)
unbound: as.Date — one of the package’s own names, itself untyped
error detail
name: as.Date
timing: 0.109 s
source
as.Date.yearmon <- function(x, frac = 0, ...) {     
  x <- unclass(x)
  if(all(is.na(x))) return(as.Date(x))
  year <- floor(x + .001)
  ix <- !is.na(year)
  month <- floor(12 * (x - year) + 1 + .5 + .001)
  dd.start <- as.Date(rep(NA, length(year)))
  dd.start[ix] <- as.Date(paste(year[ix], month[ix], 1, sep = "-")) 
  dd.end <- dd.start + 32 - as.numeric(format(dd.start + 32, "%d"))
  as.Date((1-frac) * as.numeric(dd.start) + frac * as.numeric(dd.end), origin = "1970-01-01")
}
R/yearmon.R:45

as.POSIXct.yearmon untypeable

unbound variable (line 56)
unbound: as.Date — one of the package’s own names, itself untyped
error detail
name: as.Date
timing: 0.010 s
source
as.POSIXct.yearmon <- function(x, tz = "", ...) as.POSIXct(as.Date(x), tz = tz, ...)
R/yearmon.R:56

as.POSIXlt.yearmon untypeabletyped

unbound variable (line 57)
unbound: as.Date — one of the package’s own names, itself untyped
error detail
name: as.Date
gradual mode: typed
((x: ~(DBL | INT), tz: any?, ...: any) -> any)<>
timing: 0.009 s
source
as.POSIXlt.yearmon <- function(x, tz = "", ...) as.POSIXlt(as.Date(x), tz = tz, ...)
R/yearmon.R:57

as.list.yearmon typed accepts outside

∀'a,'b. (((x: <@"[", ...>, ...: any) -> list<>) & ((x: v('b)<~@"[", ...>, ...: any) -> { v('b)<> }<>) & ((x: { 'a }<~@"[", ...>, ...: any) -> { { 'a }<> }<>))<>
timing: 0.225 s
fuzzing: 13 inside (13 ok) · 8 outside (4 rejected, 4 accepted)
type drawn from: (((x: <@"[", ...>, ...: any) -> list<>) & ((x: v('I2398)<~@"[", ...>, ...: any) -> { v('I2398)<> }<>) & ((x: { 'I2397 }<~@"[", ...>, ...: any) -> { { 'I2397 }<> }<>))<>

Accepted outside the domain x: 4

parameterchangecallreturned
xkind:langas.list.yearmon(quote(f(x)), list(), "fuzz_dot1" = new.env()){ lang<> with { } }<> with { }
xkind:langas.list.yearmon(quote(f(x)), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), as.raw(c(255, 0, 255, 0, 0))){ lang<> with { } }<> with { }
xkind:langas.list.yearmon(quote(f(x)), c(2147483647L, 1000000L, 2L, 2L, 0L)){ lang<> with { } }<> with { }
xkind:nullas.list.yearmon(NULL, quote(f(x)), function(...) new.env()){ }<> with { }
source
as.list.yearmon <- function(x, ...) lapply(seq_along(x), function(i) x[i])
R/yearmon.R:58

as.numeric.yearmon typed no call in domain

∀'a. ((x: 'a<...>, ...: any) -> 'a<>)<>
timing: 0.022 s
fuzzing: 0 inside (none) · 0 outside (none)
type drawn from: ((x: 'I2414<...>, ...: any) -> 'I2414<>)<>
source
as.numeric.yearmon <- function(x, ...) unclass(x)
R/yearmon.R:59

format.yearmon untypeabletyped

unbound variable (line 90)
unbound: as.Date — one of the package’s own names, itself untyped
error detail
name: as.Date
gradual mode: typed
((x: ~(DBL | INT), format: any?, ...: any) -> CHR<>)<>
timing: 0.039 s
source
format.yearmon <- function(x, format = "%b %Y", ...) 
{
    if (length(x) == 0) return(character(0))
    xx <- format(as.Date(x), format = format, ...)
    names(xx) <- names(x)
    xx
}
R/yearmon.R:87

as.character.yearmon untypeabletyped

unbound variable (line 60)
unbound: format.yearmon — one of the package’s own names, itself untyped
error detail
name: format.yearmon
gradual mode: typed
((x: ~(DBL | INT), ...: (absent, any)) -> CHR<>)<>
timing: 0.004 s
source
as.character.yearmon <- function(x, ...) format.yearmon(x, ...)
R/yearmon.R:60

as.data.frame.yearmon untypeable

unbound variable (line 64)
unbound: substitute — a name the prelude does not declare
error detail
name: substitute
timing: 0.092 s
source
as.data.frame.yearmon <- function(x, row.names = NULL, optional = FALSE, ...) 
{
  nrows <- length(x)
  nm <- paste(deparse(substitute(x), width.cutoff = 500), collapse = " ")
  if (is.null(row.names)) {
    if (nrows == 0) 
        row.names <- character(0)
    else if(length(row.names <- names(x)) == nrows && !any(duplicated(row.names))) {
    }
    else if(optional) row.names <- character(nrows)
    else row.names <- seq_len(nrows)
  }
  names(x) <- NULL
  value <- list(x)
  if(!optional) names(value) <- nm
  attr(value, "row.names") <- row.names
  class(value) <- "data.frame"
  value
}
R/yearmon.R:61

c.yearmon untypeabletyped

unbound variable (line 83)
unbound: as.yearmon — one of the package’s own names, itself untyped
error detail
name: as.yearmon
gradual mode: typed
((...: vec | null) -> any)<>
timing: 0.088 s
source
c.yearmon <- function(...)
    as.yearmon(do.call("c", lapply(list(...), as.numeric)))
R/yearmon.R:82

cycle.yearmon typed accepts outside

(((x: vec | null, ...: any) -> (DBL | INT)<>)&((x: vec1, ...: any) -> DBL1<>))<>
timing: 0.289 s
fuzzing: 8 inside (8 ok) · 8 outside (6 rejected, 2 accepted)

Accepted outside the domain x: 2

parameterchangecallreturned
xwrapcycle.yearmon("x" = list(-Inf))(^DBL1 \ (..))<> with { }
xwrapcycle.yearmon("x" = list(logical(0)), "fuzz_dot1" = function(...) list(new.env()))(DBL1 \ ^DBL1)<> with { }
source
cycle.yearmon <- function(x, ...) round(12 * (as.numeric(x) %% 1)) + 1
R/yearmon.R:85

print.yearmon typed fuzz ok

∀'a. ((x: 'a, ...: any) -> 'a)<>
timing: 0.057 s
fuzzing: 20 inside (17 ok, 3 error type) · 8 outside (8 rejected)
type drawn from: ((x: 'x, ...: any) -> 'x)<>

Other calls inside the domain

callverdicterror
print.yearmon(structure(-1L, "levels" = c(NA_character_, "", "NA", "é", ""), class = "factor"), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "fuzz_dot1" = as.name("x"))error_typebase::as.character.factor: malformed factor
print.yearmon(function(...) new.env(), NULL, NULL)error_typebase::print.default: invalid 'quote' argument
print.yearmon(quote(f(x)), as.name("x"), list())error_typebase::print.default: invalid printing digits -2147483648
source
print.yearmon <- function(x, ...) {
    if(length(x) == 0L) {
      cat("yearmon of length 0\n")
    } else {
      print(format(x), ...)
    }
    invisible(x) 
}
R/yearmon.R:95

months.yearmon untypeabletyped

unbound variable (line 105)
unbound: as.Date — one of the package’s own names, itself untyped
error detail
name: as.Date
gradual mode: typed
((x: ~(DBL | INT), abbreviate: any?) -> any)<>
timing: 0.007 s
source
months.yearmon <- function(x, abbreviate = FALSE) {
    months(as.Date(x), abbreviate = abbreviate)
}
R/yearmon.R:104

quarters.yearmon untypeabletyped

unbound variable (line 109)
unbound: as.Date — one of the package’s own names, itself untyped
error detail
name: as.Date
gradual mode: typed
((x: ~(DBL | INT), abbreviate: any?) -> any)<>
timing: 0.006 s
source
quarters.yearmon <- function(x, abbreviate = FALSE) {
    quarters(as.Date(x), abbreviate = abbreviate)
}
R/yearmon.R:108

[.yearmon untypeabletyped

unbound variable (line 114)
unbound: oldClass — a name the prelude does not declare
error detail
name: oldClass
gradual mode: typed
((x: <...>, ...: any, drop: any?) -> any)<>
timing: 0.006 s
source
"[.yearmon" <- function (x, ..., drop = TRUE) 
{
    cl <- oldClass(x)
    class(x) <- NULL
    val <- NextMethod("[")
    class(val) <- cl
    val
}
R/yearmon.R:112

[[.yearmon untypeabletyped

unbound variable (line 123)
unbound: oldClass — a name the prelude does not declare
error detail
name: oldClass
gradual mode: typed
((x: <...>, ...: any, drop: any?) -> any)<>
timing: 0.006 s
source
"[[.yearmon" <- function (x, ..., drop = TRUE) 
{
    cl <- oldClass(x)
    class(x) <- NULL
    val <- NextMethod("[[")
    class(val) <- cl
    val
}
R/yearmon.R:121

[<-.yearmon untypeable

unbound variable (line 132)
unbound: oldClass — a name the prelude does not declare
error detail
name: oldClass
timing: 0.006 s
source
"[<-.yearmon" <- function (x, ..., value) 
{
    cl <- oldClass(x)
    value <- unclass(as.yearmon(value))
    class(x) <- NULL
    val <- NextMethod("[")
    class(val) <- cl
    val
}
R/yearmon.R:130

MATCH.yearmon untypeabletyped

unbound variable (line 141)
unbound: match — a name the prelude does not declare
error detail
name: match
gradual mode: typed
((x: vec | null, table: vec | null, nomatch: any?, ...: any) -> any)<>
timing: 0.514 s
source
MATCH.yearmon <- function(x, table, nomatch = NA, ...)
    match(floor(12*as.numeric(x) + .001), floor(12*as.numeric(table) + .001), nomatch = nomatch, ...)
R/yearmon.R:140

Ops.yearmon untypeable

unbound variable (line 144)
unbound: as.yearmon — one of the package’s own names, itself untyped
error detail
name: as.yearmon
timing: 0.018 s
source
Ops.yearmon <- function(e1, e2) {
    e1 <- as.numeric(as.yearmon(e1))
    e2 <- as.numeric(as.yearmon(e2))
    rval <- NextMethod(.Generic)
    if(is.numeric(rval)) rval <- yearmon(rval)
    return(rval)
}
R/yearmon.R:143

-.yearmon untypeabletyped

unbound variable (line 155)
unbound: nargs — a name the prelude does not declare
error detail
name: nargs
gradual mode: typed
(((e1: dbl, e2: dbl<~@"+", ~@"/", ...> with { class: null, any }) -> (DBL | INT)<> | DBL)&((e1: dbl1, e2: dbl1<~@"+", ~@"/", ...> with { class: null, any }) -> DBL)&((e1: vec | null, e2: vec with { class: ~null, any }) -> (DBL | INT)<>)&((e1: vec1, e2: vec1 with { class: ~null, any }) -> DBL1<>))<>
timing: 0.052 s
source
"-.yearmon" <- function (e1, e2) 
{
    if (!inherits(e1, "yearmon")) 
        stop("Can only subtract from yearmon objects")
    if (nargs() == 1) 
	return(- as.numeric(e1))
    if (inherits(e2, "yearmon")) 
        return(as.numeric(e1) - as.numeric(e2))
    if (!is.null(attr(e2, "class"))) 
      stop("can only subtract yearmon objects and numbers from yearmon objects")
    yearmon(unclass(e1) - e2)
}
R/yearmon.R:151

is.numeric.yearmon typed any: x accepts outside

((x: any) -> ff<>)<>
timing: 0.007 s
fuzzing: 7 inside (7 ok) · 8 outside (7 rejected, 1 accepted)

Accepted outside the domain x: 1

parameterchangecallreturned
xdropis.numeric.yearmon()ff<> with { }
source
is.numeric.yearmon <- function(x) FALSE
R/yearmon.R:164

axis.yearmon untypeable

unbound variable (line 175)
unbound: as.yearmon — one of the package’s own names, itself untyped
error detail
name: as.yearmon
timing: 0.458 s
source
axis.yearmon <- function (side, x, at, format, labels = TRUE, ..., N1 = 25, N2 = 2) {
    # If years in range > N1 then only years shown.  
    # If years in range > N2 then month ticks are not labelled.
    mat <- missing(at) || is.null(at)
    if (!mat) # at not missing
        x <- as.yearmon(at)
    else x <- as.yearmon(x)
    range <- par("usr")[if (side%%2) 
        1:2
    else 3:4]
    # range[1] <- ceiling(range[1])
    # range[2] <- floor(range[2])
    d <- range[2] - range[1]
    z <- c(range, x[is.finite(x)])
    class(z) <- "yearmon"
    if (d > N1) { # axis has years only
        z <- structure(pretty(z), class = "yearmon")
    } else if (d > N2) { # axis has all years and unlabelled months
        z <- seq(min(x), max(x), 1/12)
	# z <- seq(floor(min(x)), ceiling(max(x)))
    } else { # years and months
        z <- seq(min(x), max(x), 1/12)
    }
    if (!mat) 
        z <- x[is.finite(x)]
    z <- z[z >= range[1] & z <= range[2]]
    z <- sort(unique(z))
    class(z) <- "yearmon"
    if (identical(labels, TRUE)) {
	if (missing(format)) format <- c("%Y", "%b")
	if (length(format) == 1) format <- c(format, "")
	labels <- if (d <= N2) format.yearmon(z, format = format[2])
    else rep(NA, length(z))
	idx <- format.yearmon(z, format = "%m") == "01"
	labels[idx] <- format.yearmon(z[idx], format = format[1])
    } else if (identical(labels, FALSE)) 
        labels <- rep("", length(z))
    axis(side, at = z, labels = labels, ...)
}
R/yearmon.R:169

Axis.yearmon skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
Axis.yearmon <- function(x = NULL, at = NULL, ..., side, labels = NULL)
    axis.yearmon(x = x, at = at, ..., side = side, labels = TRUE)
R/yearmon.R:166

summary.yearmon untypeabletyped

unbound variable (line 210)
unbound: summary — a name the prelude does not declare
error detail
name: summary
gradual mode: typed
((object: vec | null, ...: any) -> any)<>
timing: 0.021 s
source
summary.yearmon <- function(object, ...)
  summary(as.numeric(object), ...)
R/yearmon.R:209

as.yearmon.date untypeabletyped

unbound variable (line 216)
unbound: as.Date — one of the package’s own names, itself untyped
error detail
name: as.Date
gradual mode: typed
((x: ~(DBL | INT), ...: any) -> any)<>
timing: 0.005 s
source
as.yearmon.date <- function(x, ...) {
	as.yearmon(as.Date(x, ...))
}
R/yearmon.R:215

mean.yearmon untypeabletyped

unbound variable (line 219)
unbound: mean — a name the prelude does not declare
error detail
name: mean
gradual mode: typed
((x: <...>, ...: any) -> any)<>
timing: 0.013 s
source
mean.yearmon <- function (x, ...) as.yearmon(mean(unclass(x), ...))
R/yearmon.R:219

Summary.yearmon skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.005 s
source
Summary.yearmon <- function (..., na.rm)
{
    ok <- switch(.Generic, max = , min = , range = TRUE, FALSE)
    if (!ok) stop(.Generic, " not defined for yearmon objects")
    val <- NextMethod(.Generic)
    class(val) <- oldClass(list(...)[[1]])
    val
}
R/yearmon.R:221

Sys.yearmon untypeabletyped

unbound variable (line 230)
unbound: as.yearmon — one of the package’s own names, itself untyped
error detail
name: as.yearmon
gradual mode: typed
(() -> any)<>
timing: 0.002 s
source
Sys.yearmon <- function() as.yearmon(Sys.Date())
R/yearmon.R:230

range.yearmon skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
range.yearmon <- function(..., na.rm = FALSE) {
	as.yearmon(range.default(..., na.rm = na.rm))
}
R/yearmon.R:232

unique.yearmon untypeabletyped

unbound variable (line 237)
unbound: unique.default — a name the prelude does not declare
error detail
name: unique.default
gradual mode: typed
((x: any, incomparables: any?, ...: any) -> any)<>
timing: 0.010 s
source
unique.yearmon <- function(x, incomparables = FALSE, ...) {
	as.yearmon(unique.default(x, incomparables = incomparables, ...))
}
R/yearmon.R:236

xtfrm.yearmon typed accepts outside

(((x: vec | null) -> DBL<>)&((x: vec1) -> DBL1<>))<>
timing: 0.036 s
fuzzing: 8 inside (8 ok) · 7 outside (5 rejected, 2 accepted)

Accepted outside the domain x: 2

parameterchangecallreturned
xwrapxtfrm.yearmon("x" = list(2L))2.<> with { }
xwrapxtfrm.yearmon("x" = list(0.5))(^DBL1 \ (..))<> with { }
source
xtfrm.yearmon <- function(x) as.numeric(x)
R/yearmon.R:240

diff.yearmon untypeabletyped

unbound variable (line 242)
unbound: NextMethod — a name the prelude does not declare
error detail
name: NextMethod
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.004 s
source
diff.yearmon <- function(x, ...) as.numeric(NextMethod())
R/yearmon.R:242
R/yearqtr.R

yearqtr typed accepts outside

((x: dbl<~@"+", ~@"/", ...>) -> DBL)<>
timing: 0.370 s
fuzzing: 8 inside (5 ok, 3 error type) · 6 outside (4 rejected, 2 accepted)

Accepted outside the domain x: 2

parameterchangecallreturned
xkind:nullyearqtr(NULL)(DBL & ~vec1)<yearqtr> with { }
xkind:nullyearqtr("x" = NULL)(DBL & ~vec1)<yearqtr> with { }

Other calls inside the domain

callverdicterror
yearqtr(as.raw(c(255, 255, 0, 0, 0)))error_typebase::*: non-numeric argument to binary operator
yearqtr(as.raw(c(0)))error_typebase::*: non-numeric argument to binary operator
yearqtr("x" = as.raw(c(255)))error_typebase::*: non-numeric argument to binary operator
source
yearqtr <- function(x) structure(floor(4*x + .001)/4, class = "yearqtr")
R/yearqtr.R:2

as.yearqtr untypeabletyped

unbound variable (line 5)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.004 s
source
as.yearqtr <- function(x, ...) UseMethod("as.yearqtr")
R/yearqtr.R:5

as.yearqtr.default untypeabletyped

unbound variable (line 6)
unbound: as.yearqtr — one of the package’s own names, itself untyped
error detail
name: as.yearqtr
gradual mode: typed
((x: vec | null, ...: any) -> any)<>
timing: 0.020 s
source
as.yearqtr.default <- function(x, ...) as.yearqtr(as.numeric(x))
R/yearqtr.R:6

as.yearqtr.numeric typed accepts outside

((x: dbl<~@"+", ~@"/", ...>, ...: any) -> DBL)<>
timing: 0.030 s
fuzzing: 8 inside (6 ok, 2 error type) · 8 outside (7 rejected, 1 accepted)

Accepted outside the domain x: 1

parameterchangecallreturned
xkind:nullas.yearqtr.numeric("x" = NULL, "fuzz_dot1" = as.name("x"))(DBL & ~vec1)<yearqtr> with { }

Other calls inside the domain

callverdicterror
as.yearqtr.numeric(as.raw(c(0)), "fuzz_dot1" = new.env(), "fuzz_dot2" = function(...) as.name("x"))error_typebase::*: non-numeric argument to binary operator
as.yearqtr.numeric("x" = as.raw(c(0)), "fuzz_dot1" = new.env(), "fuzz_dot2" = list())error_typebase::*: non-numeric argument to binary operator
source
as.yearqtr.numeric <- function(x, ...) yearqtr(x)
R/yearqtr.R:7

as.yearqtr.integer typed accepts outside

((x: vec | null, ...: any) -> DBL)<>
timing: 0.050 s
fuzzing: 8 inside (8 ok) · 7 outside (6 rejected, 1 accepted)

Accepted outside the domain x: 1

parameterchangecallreturned
xwrapas.yearqtr.integer("x" = list(logical(0)), "fuzz_dot1" = NULL, "fuzz_dot2" = new.env())(DBL1 \ ^DBL1)<yearqtr> with { }
source
as.yearqtr.integer <- function(x, ...) structure(as.numeric(x), class = "yearqtr")
R/yearqtr.R:8

as.yearqtr.mondate untypeabletyped

unbound variable (line 16)
unbound: as.yearmon — one of the package’s own names, itself untyped
error detail
name: as.yearmon
gradual mode: typed
null
timing: 0.021 s
source
as.yearqtr.mondate <-
as.yearqtr.jul <- # jul is in tis package
as.yearqtr.timeDate <-
as.yearqtr.dates <-
as.yearqtr.Date <- 
as.yearqtr.POSIXt <- function(x, ...) as.yearqtr(as.yearmon(x))
R/yearqtr.R:11

as.yearqtr.yearqtr typed fuzz ok

∀'a. ((x: 'a, ...: any) -> 'a)<>
timing: 0.009 s
fuzzing: 20 inside (20 ok) · 8 outside (8 rejected)
type drawn from: ((x: 'x, ...: any) -> 'x)<>
source
as.yearqtr.yearqtr <- function(x, ...) x
R/yearqtr.R:17

as.yearqtr.factor untypeabletyped

unbound variable (line 19)
unbound: as.yearqtr — one of the package’s own names, itself untyped
error detail
name: as.yearqtr
gradual mode: typed
((x: vec | null, ...: any) -> any)<>
timing: 0.021 s
source
as.yearqtr.factor <- function(x, ...) as.yearqtr(as.character(x), ...)
R/yearqtr.R:19

as.yearqtr.character untypeable

unbound variable (line 31)
unbound: as.yearmon — one of the package’s own names, itself untyped
error detail
name: as.yearmon
timing: 3.25 s
source
as.yearqtr.character <- function(x, format, ...) {
    non.na <- x[!is.na(x)]
    if (length(non.na) == 0L) 
        return(structure(rep(NA_real_, length(x)), class = "yearqtr"))
    if (missing(format) || format == "") {
        format <- if (all(regexpr("q", non.na) > 0))  { "%Y q%q"
        } else if (all(regexpr("Q", non.na) > 0)) { "%Y Q%q"
        } else "%Y-%q"
    }
    y <- if (regexpr("%[qQ]", format) > 0) {
        format <- sub("%q", "%m", format)
        y <- as.numeric(as.yearmon(x, format))
        m0 <- round(12 * (y %% 1))
        floor(y) + ifelse(m0 > 3, NA, m0/4)
    } else as.yearmon(x, format)
    as.yearqtr(y)
}
R/yearqtr.R:20

as.yearqtr.ti untypeabletyped

unbound variable (line 37)
unbound: as.Date — one of the package’s own names, itself untyped
error detail
name: as.Date
gradual mode: typed
((x: ~(DBL | INT), ...: any) -> any)<>
timing: 0.004 s
source
as.yearqtr.ti <- function(x, ...) as.yearqtr(as.Date(x), ...)
R/yearqtr.R:37

as.Date.yearqtr untypeable

unbound variable (line 43)
unbound: as.Date — one of the package’s own names, itself untyped
error detail
name: as.Date
timing: 0.101 s
source
as.Date.yearqtr <- function(x, frac = 0, ...) {
  x <- unclass(x)
  if(all(is.na(x))) return(as.Date(x))
  year <- floor(x + .001)
  ix <- !is.na(year)
  month <- floor(12 * (x - year) + 1 + .5 + .001)
  dd.start <- as.Date(rep(NA, length(year)))
  dd.start[ix] <- as.Date(paste(year[ix], month[ix], 1, sep = "-")) 
  dd.end <- dd.start + 100 - as.numeric(format(dd.start + 100, "%d")) 
  as.Date((1-frac) * as.numeric(dd.start) + frac * as.numeric(dd.end), origin = "1970-01-01")
}
R/yearqtr.R:41

as.POSIXct.yearqtr untypeable

unbound variable (line 52)
unbound: as.Date — one of the package’s own names, itself untyped
error detail
name: as.Date
timing: 0.009 s
source
as.POSIXct.yearqtr <- function(x, tz = "", ...) as.POSIXct(as.Date(x), tz = tz, ...)
R/yearqtr.R:52

as.POSIXlt.yearqtr untypeabletyped

unbound variable (line 53)
unbound: as.Date — one of the package’s own names, itself untyped
error detail
name: as.Date
gradual mode: typed
((x: ~(DBL | INT), tz: any?, ...: any) -> any)<>
timing: 0.008 s
source
as.POSIXlt.yearqtr <- function(x, tz = "", ...) as.POSIXlt(as.Date(x), tz = tz, ...)
R/yearqtr.R:53

as.list.yearqtr typed accepts outside

∀'a,'b. (((x: <@"[", ...>, ...: any) -> list<>) & ((x: v('b)<~@"[", ...>, ...: any) -> { v('b)<> }<>) & ((x: { 'a }<~@"[", ...>, ...: any) -> { { 'a }<> }<>))<>
timing: 0.220 s
fuzzing: 13 inside (13 ok) · 8 outside (5 rejected, 3 accepted)
type drawn from: (((x: <@"[", ...>, ...: any) -> list<>) & ((x: v('I3173)<~@"[", ...>, ...: any) -> { v('I3173)<> }<>) & ((x: { 'I3172 }<~@"[", ...>, ...: any) -> { { 'I3172 }<> }<>))<>

Accepted outside the domain x: 3

parameterchangecallreturned
xkind:envas.list.yearqtr(new.env(), list(), "fuzz_dot1" = as.name("x"), "fuzz_dot2" = FALSE){ }<> with { }
xkind:nullas.list.yearqtr("x" = NULL){ }<> with { }
xkind:nullas.list.yearqtr("x" = NULL, "fuzz_dot1" = new.env(), "fuzz_dot2" = list(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), as.name("x"))){ }<> with { }
source
as.list.yearqtr <- function(x, ...) lapply(seq_along(x), function(i) x[i])
R/yearqtr.R:54

as.numeric.yearqtr typed no call in domain

∀'a. ((x: 'a<...>, ...: any) -> 'a<>)<>
timing: 0.026 s
fuzzing: 0 inside (none) · 0 outside (none)
type drawn from: ((x: 'I3189<...>, ...: any) -> 'I3189<>)<>
source
as.numeric.yearqtr <- function(x, ...) unclass(x)
R/yearqtr.R:55

format.yearqtr skipped

error detail
Invalid_argument("Variable ..._5 is already bound.")
timing: 0.057 s
source
format.yearqtr <- function(x, format = "%Y Q%q", ...) 
{
  if (length(x) == 0) return(character(0))
  # like gsub but replacement and x may be vectors the same length
  gsub.vec <- function(pattern, replacement, x, ...) {
    y <- x
    for(i in seq_along(x)) {
      y[i] <- gsub(pattern, replacement[i], x[i], ...)
    }
    y
  }
  x <- as.yearqtr(x)
  x <- unclass(x)
  year <- floor(x + .001)
  qtr <- floor(4*(x - year) + 1 + .5 + .001)
  xx <- if (format == "%Y Q%q") {
    paste(year, " Q", qtr, sep = "")
  } else {
    # TODO: speed up the following
    xx <- gsub.vec("%q", qtr, rep.int(format, length(qtr)))
    xx <- gsub.vec("%Y", year, xx)
    xx <- gsub.vec("%y", sprintf("%02d", as.integer(year %% 100)), xx)
    xx <- gsub.vec("%C", year %/% 100, xx)
    xx
  }
  names(xx) <- names(x)
  xx[is.na(x)] <- NA_character_
  return(xx)
}
R/yearqtr.R:85

as.character.yearqtr untypeabletyped

unbound variable (line 56)
unbound: format.yearqtr — one of the package’s own names, itself untyped
error detail
name: format.yearqtr
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.005 s
source
as.character.yearqtr <- function(x, ...) format.yearqtr(x, ...)
R/yearqtr.R:56

as.data.frame.yearqtr untypeable

unbound variable (line 60)
unbound: substitute — a name the prelude does not declare
error detail
name: substitute
timing: 0.099 s
source
as.data.frame.yearqtr <- function(x, row.names = NULL, optional = FALSE, ...) 
{
  nrows <- length(x)
  nm <- paste(deparse(substitute(x), width.cutoff = 500), collapse = " ")
  if (is.null(row.names)) {
    if (nrows == 0) 
        row.names <- character(0)
    else if(length(row.names <- names(x)) == nrows && !any(duplicated(row.names))) {
    }
    else if(optional) row.names <- character(nrows)
    else row.names <- seq_len(nrows)
  }
  names(x) <- NULL
  value <- list(x)
  if(!optional) names(value) <- nm
  attr(value, "row.names") <- row.names
  class(value) <- "data.frame"
  value
}
R/yearqtr.R:57

c.yearqtr untypeabletyped

unbound variable (line 80)
unbound: as.yearqtr — one of the package’s own names, itself untyped
error detail
name: as.yearqtr
gradual mode: typed
((...: vec | null) -> any)<>
timing: 0.066 s
source
c.yearqtr <- function(...) {
    as.yearqtr(do.call("c", lapply(list(...), as.numeric)))
}
R/yearqtr.R:79

cycle.yearqtr typed accepts outside

(((x: vec | null, ...: any) -> (DBL | INT)<>)&((x: vec1, ...: any) -> DBL1<>))<>
timing: 0.271 s
fuzzing: 8 inside (8 ok) · 8 outside (6 rejected, 2 accepted)

Accepted outside the domain x: 2

parameterchangecallreturned
xwrapcycle.yearqtr("x" = list(-1), "fuzz_dot1" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "fuzz_dot2" = NULL)1.<> with { }
xwrapcycle.yearqtr(list(1000000L), NULL, quote(f(x)), "fuzz_dot1" = new.env(), "fuzz_dot2" = as.name("x"))1.<> with { }
source
cycle.yearqtr <- function(x, ...) round(4 * (as.numeric(x) %% 1)) + 1
R/yearqtr.R:83

months.yearqtr untypeabletyped

unbound variable (line 117)
unbound: as.Date — one of the package’s own names, itself untyped
error detail
name: as.Date
gradual mode: typed
((x: ~(DBL | INT), abbreviate: any?) -> any)<>
timing: 0.006 s
source
months.yearqtr <- function(x, abbreviate = FALSE) {
    months(as.Date(x), abbreviate = abbreviate)
}
R/yearqtr.R:116

quarters.yearqtr untypeabletyped

unbound variable (line 121)
unbound: as.Date — one of the package’s own names, itself untyped
error detail
name: as.Date
gradual mode: typed
((x: ~(DBL | INT), abbreviate: any?) -> any)<>
timing: 0.006 s
source
quarters.yearqtr <- function(x, abbreviate = FALSE) {
    quarters(as.Date(x), abbreviate = abbreviate)
}
R/yearqtr.R:120

print.yearqtr typed fuzz ok

∀'a. ((x: 'a, ...: any) -> 'a)<>
timing: 0.054 s
fuzzing: 20 inside (16 ok, 4 error type) · 8 outside (8 rejected)
type drawn from: ((x: 'x, ...: any) -> 'x)<>

Other calls inside the domain

callverdicterror
print.yearqtr(NA_complex_, as.name("x"), "fuzz_dot1" = quote(f(x)), "fuzz_dot2" = NULL)error_typebase::print.default: invalid printing digits -2147483648
print.yearqtr(as.raw(c(255)), complex(0), function(...) quote(f(x)), "fuzz_dot1" = as.name("x"))error_typebase::print.default: invalid printing digits -2147483648
print.yearqtr("", list(), as.raw(c(0)))error_typebase::print.default: invalid printing digits -2147483648
print.yearqtr(list("a" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p })), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "fuzz_dot1" = new.env())error_typebase::print.default: invalid printing digits -2147483648
source
print.yearqtr <- function(x, ...) {
    if(length(x) == 0L) {
      cat("yearqtr of length 0\n")
    } else {
      print(format(x), ...)
    }
    invisible(x) 
}
R/yearqtr.R:125

[.yearqtr untypeabletyped

unbound variable (line 136)
unbound: oldClass — a name the prelude does not declare
error detail
name: oldClass
gradual mode: typed
((x: <...>, ...: any, drop: any?) -> any)<>
timing: 0.006 s
source
"[.yearqtr" <- function (x, ..., drop = TRUE) 
{
    cl <- oldClass(x)
    class(x) <- NULL
    val <- NextMethod("[")
    class(val) <- cl
    val
}
R/yearqtr.R:134

[[.yearqtr untypeabletyped

unbound variable (line 145)
unbound: oldClass — a name the prelude does not declare
error detail
name: oldClass
gradual mode: typed
((x: <...>, ...: any, drop: any?) -> any)<>
timing: 0.006 s
source
"[[.yearqtr" <- function (x, ..., drop = TRUE) 
{
    cl <- oldClass(x)
    class(x) <- NULL
    val <- NextMethod("[[")
    class(val) <- cl
    val
}
R/yearqtr.R:143

[<-.yearqtr untypeable

unbound variable (line 154)
unbound: oldClass — a name the prelude does not declare
error detail
name: oldClass
timing: 0.006 s
source
"[<-.yearqtr" <- function (x, ..., value) 
{
    cl <- oldClass(x)
    value <- unclass(as.yearqtr(value))
    class(x) <- NULL
    val <- NextMethod("[")
    class(val) <- cl
    val
}
R/yearqtr.R:152

MATCH.yearqtr untypeabletyped

unbound variable (line 163)
unbound: match — a name the prelude does not declare
error detail
name: match
gradual mode: typed
((x: vec | null, table: vec | null, nomatch: any?, ...: any) -> any)<>
timing: 0.551 s
source
MATCH.yearqtr <- function(x, table, nomatch = NA, ...)
    match(floor(4*as.numeric(x) + .001), floor(4*as.numeric(table) + .001), nomatch = nomatch, ...)
R/yearqtr.R:162

Ops.yearqtr untypeable

unbound variable (line 166)
unbound: as.yearqtr — one of the package’s own names, itself untyped
error detail
name: as.yearqtr
timing: 0.018 s
source
Ops.yearqtr <- function(e1, e2) {
    e1 <- as.numeric(as.yearqtr(e1))
    e2 <- as.numeric(as.yearqtr(e2))
    rval <- NextMethod(.Generic)
    if(is.numeric(rval)) rval <- yearqtr(rval)
    return(rval)
}
R/yearqtr.R:165

-.yearqtr untypeabletyped

unbound variable (line 178)
unbound: nargs — a name the prelude does not declare
error detail
name: nargs
gradual mode: typed
(((e1: dbl, e2: dbl<~@"+", ~@"/", ...> with { class: null, any }) -> (DBL | INT)<> | DBL)&((e1: dbl1, e2: dbl1<~@"+", ~@"/", ...> with { class: null, any }) -> DBL)&((e1: vec | null, e2: vec with { class: ~null, any }) -> (DBL | INT)<>)&((e1: vec1, e2: vec1 with { class: ~null, any }) -> DBL1<>))<>
timing: 0.051 s
source
"-.yearqtr" <- function (e1, e2) 
{
    if (!inherits(e1, "yearqtr")) 
        stop("Can only subtract from yearqtr objects")
    if (nargs() == 1) 
	return(- as.numeric(e1))
    if (inherits(e2, "yearqtr")) 
        return(as.numeric(e1) - as.numeric(e2))
    if (!is.null(attr(e2, "class"))) 
      stop("can only subtract yearqtr objects and numbers from yearqtr objects")
    yearqtr(unclass(e1) - e2)
}
R/yearqtr.R:174

is.numeric.yearqtr typed any: x accepts outside

((x: any) -> ff<>)<>
timing: 0.007 s
fuzzing: 8 inside (8 ok) · 5 outside (4 rejected, 1 accepted)

Accepted outside the domain x: 1

parameterchangecallreturned
xdropis.numeric.yearqtr()ff<> with { }
source
is.numeric.yearqtr <- function(x) FALSE
R/yearqtr.R:187

axis.yearqtr untypeable

unbound variable (line 199)
unbound: as.yearqtr — one of the package’s own names, itself untyped
error detail
name: as.yearqtr
timing: 0.429 s
source
axis.yearqtr <- function (side, x, at, format, labels = TRUE, ..., N1 = 25, N2 = 7) {
    # If years in range > N1 then only years shown.  
    # If years in range > N2 then quarter ticks are not labelled.
    mat <- missing(at) || is.null(at)
    if (!mat) # at not missing
        x <- as.yearqtr(at)
    else x <- as.yearqtr(x)
    range <- par("usr")[if (side%%2) 
        1:2
    else 3:4]
    # range[1] <- ceiling(range[1])
    # range[2] <- floor(range[2])
    d <- range[2] - range[1]
    z <- c(range, x[is.finite(x)])
    class(z) <- "yearqtr"
    if (d > N1) { # axis has years only
        z <- structure(pretty(z), class = "yearqtr")
    } else if (d > N2) { # axis has all years and unlabelled quarters
        z <- seq(min(x), max(x), 0.25)
	# z <- seq(floor(min(x)), ceiling(max(x)))
    } else { # years and quarters
        z <- seq(min(x), max(x), 0.25)
    }
    if (!mat) 
        z <- x[is.finite(x)]
    z <- z[z >= range[1] & z <= range[2]]
    z <- sort(unique(z))
    class(z) <- "yearqtr"
    if (identical(labels, TRUE)) {
	if (missing(format)) format <- c("%Y", "Q%q")
	if (length(format) == 1) format <- c(format, "")
	if (d <= N2) labels <- format.yearqtr(z, format = format[2])
	idx <- format.yearqtr(z, format = "%q") == "1"
	labels <- rep(NA, length(z))
	labels[idx] <- format.yearqtr(z[idx], format = format[1])
    } else if (identical(labels, FALSE)) 
        labels <- rep("", length(z))
    axis(side, at = z, labels = labels, ...)
}
R/yearqtr.R:193

Axis.yearqtr skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
Axis.yearqtr <- function(x = NULL, at = NULL, ..., side, labels = NULL)
    axis.yearqtr(x = x, at = at, ..., side = side, labels = TRUE)
R/yearqtr.R:189

summary.yearqtr untypeabletyped

unbound variable (line 234)
unbound: summary — a name the prelude does not declare
error detail
name: summary
gradual mode: typed
((object: vec | null, ...: any) -> any)<>
timing: 0.022 s
source
summary.yearqtr <- function(object, ...)
  summary(as.numeric(object), ...)
R/yearqtr.R:233

as.yearqtr.date untypeabletyped

unbound variable (line 238)
unbound: as.Date — one of the package’s own names, itself untyped
error detail
name: as.Date
gradual mode: typed
((x: ~(DBL | INT), ...: any) -> any)<>
timing: 0.005 s
source
as.yearqtr.date <- function(x, ...) {
	as.yearqtr(as.Date(x, ...))
}
R/yearqtr.R:237

mean.yearqtr untypeabletyped

unbound variable (line 241)
unbound: mean — a name the prelude does not declare
error detail
name: mean
gradual mode: typed
((x: <...>, ...: any) -> any)<>
timing: 0.012 s
source
mean.yearqtr <- function (x, ...) as.yearqtr(mean(unclass(x), ...))
R/yearqtr.R:241

Summary.yearqtr skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.004 s
source
Summary.yearqtr <- function (..., na.rm)
{
    ok <- switch(.Generic, max = , min = , range = TRUE, FALSE)
    if (!ok) stop(.Generic, " not defined for yearqtr objects")
    val <- NextMethod(.Generic)
    class(val) <- oldClass(list(...)[[1]])
    val
}
R/yearqtr.R:243

Sys.yearqtr untypeabletyped

unbound variable (line 252)
unbound: as.yearqtr — one of the package’s own names, itself untyped
error detail
name: as.yearqtr
gradual mode: typed
(() -> any)<>
timing: 0.001 s
source
Sys.yearqtr <- function() as.yearqtr(Sys.Date())
R/yearqtr.R:252

range.yearqtr skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
range.yearqtr <- function(..., na.rm = FALSE) {
	as.yearqtr(range.default(..., na.rm = na.rm))
}
R/yearqtr.R:254

unique.yearqtr untypeabletyped

unbound variable (line 259)
unbound: unique.default — a name the prelude does not declare
error detail
name: unique.default
gradual mode: typed
((x: any, incomparables: any?, ...: any) -> any)<>
timing: 0.010 s
source
unique.yearqtr <- function(x, incomparables = FALSE, ...) {
	as.yearqtr(unique.default(x, incomparables = incomparables, ...))
}
R/yearqtr.R:258

xtfrm.yearqtr typed accepts outside

(((x: vec | null) -> DBL<>)&((x: vec1) -> DBL1<>))<>
timing: 0.037 s
fuzzing: 7 inside (7 ok) · 8 outside (6 rejected, 2 accepted)

Accepted outside the domain x: 2

parameterchangecallreturned
xwrapxtfrm.yearqtr(list(2147483647L))2147483647.<> with { }
xwrapxtfrm.yearqtr("x" = list(TRUE))1.<> with { }
source
xtfrm.yearqtr <- function(x) as.numeric(x)
R/yearqtr.R:262

diff.yearqtr untypeabletyped

unbound variable (line 264)
unbound: NextMethod — a name the prelude does not declare
error detail
name: NextMethod
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.005 s
source
diff.yearqtr <- function(x, ...) as.numeric(NextMethod())
R/yearqtr.R:264
R/zoo.R

zoo untypeable

unbound variable (line 1)
unbound: index — one of the package’s own names, itself untyped
error detail
name: index
timing: 0.392 s
source
zoo <- function (x = NULL, order.by = index(x), frequency = NULL,
  calendar = getOption("zoo.calendar", TRUE)) 
{
    ## process index "order.by"    
    if(length(unique(MATCH(order.by, order.by))) < length(order.by))
      warning(paste("some methods for", dQuote("zoo"),
      "objects do not work if the index entries in", sQuote("order.by"), "are not unique"))
    index <- ORDER(order.by)
    order.by <- order.by[index]

    if(is.matrix(x) || is.data.frame(x)) x <- as.matrix(x)
    if(is.matrix(x) && sum(dim(x)) < 1L) x <- NULL
    if(missing(x) || is.null(x))
      x <- numeric()
    else if(is.factor(x))         
      x <- factor(rep(as.character(x), length.out = length(index))[index],
        levels = levels(x), ordered = is.ordered(x))
    else if(is.matrix(x) || is.data.frame(x)) 
      x <- (x[rep(1:NROW(x), length.out = length(index)), , 
        drop = FALSE])[index, , drop = FALSE]
    else if(is.atomic(x)) 
      x <- rep(x, length.out = length(index))[index]
    else stop(paste(dQuote("x"), ": attempt to define invalid zoo object"))

    if(!is.null(frequency)) {
      delta <- suppressWarnings(try(diff(as.numeric(order.by)), silent = TRUE))
      freqOK <- if(inherits(delta, "try-error") || anyNA(delta)) FALSE
        else if(length(delta) < 1) TRUE
        else identical(all.equal(delta*frequency, round(delta*frequency)), TRUE)
      if(!freqOK) {
        warning(paste(dQuote("order.by"), "and", dQuote("frequency"),
        	"do not match:", dQuote("frequency"), "ignored"))
        frequency <- NULL
      } else {
        if(frequency > 1 && identical(all.equal(frequency, round(frequency)), TRUE))
	  frequency <- round(frequency)
      }
      if(!is.null(frequency) && identical(class(order.by), "numeric") | identical(class(order.by), "integer")) {
        orig.order.by <- order.by
        order.by <- floor(frequency * order.by + .0001)/frequency
        if(!isTRUE(all.equal(order.by, orig.order.by))) order.by <- orig.order.by
	if(calendar && frequency %in% c(4, 12)) {
	  order.by <- if(frequency == 4) as.yearqtr(order.by) else as.yearmon(order.by)	
	}
      }
    }

    attr(x, "oclass") <- attr(x, "class")
    attr(x, "index") <- order.by
    attr(x, "frequency") <- frequency
    class(x) <- if(is.null(frequency)) "zoo" else c("zooreg", "zoo")
    return(x)
}
R/zoo.R:1

print.zoo untypeabletyped

unbound variable (line 55)
unbound: ifelse — a name the prelude does not declare
error detail
name: ifelse
gradual mode: typed
∀'a. (((x: 'a & any with { dim: null, any }, style: (vec | null)?, quote: any?, ...: any) -> empty)&((x: 'a & any with { frequency: any, any }, style: (vec | null)?, quote: any?, ...: any) -> 'a))<>
timing: 0.193 s
source
print.zoo <- function (x, style = ifelse(length(dim(x)) == 0,
    "horizontal", "vertical"), quote = FALSE, ...) 
{
    style <- match.arg(style, c("horizontal", "vertical", "plain"))
    if (is.null(dim(x)) && length(x) == 0) style <- "plain"
    if (length(dim(x)) > 0 && style == "horizontal") style <- "plain"
    if (style == "vertical") {
	y <- as.matrix(coredata(x))
        if (length(colnames(x)) < 1) {
            colnames(y) <- rep("", NCOL(x))
        }
		if (NROW(y) > 0) {
			rownames(y) <- index2char(index(x), frequency = attr(x, "frequency"))
		}
        print(y, quote = quote, ...)
    }
    else if (style == "horizontal") {
        y <- as.vector(x)
        names(y) <- index2char(index(x), frequency = attr(x, "frequency"))
        print(y, quote = quote, ...)
    }
    else {
        cat("Data:\n")
        print(coredata(x))
        cat("\nIndex:\n")
        print(index(x))
    }
    invisible(x)
}
R/zoo.R:55

summary.zoo untypeabletyped

unbound variable (line 87)
unbound: as.data.frame — a name the prelude does not declare
error detail
name: as.data.frame
gradual mode: typed
((object: any, ...: any) -> any)<>
timing: 0.032 s
source
summary.zoo <- function(object, ...) 
{
	y <- as.data.frame(object, row.names = NULL)
	if (length(colnames(object)) < 1) {
		lab <- deparse(substitute(object))
		colnames(y) <- if (NCOL(object) == 1) lab
		  else paste(lab, 1:NCOL(object), sep=".")
	}
	if (NROW(y) > 0) {
		summary(cbind(data.frame(Index = index(object)), y), ...)
	} else summary(data.frame(Index = index(object)), ...)
}
R/zoo.R:85

is.zoo typed any: object fuzz ok

((object: any) -> LGL1<>)<>
timing: 0.013 s
fuzzing: 7 inside (7 ok) · 8 outside (8 rejected)
source
is.zoo <- function(object)
  inherits(object, "zoo")
R/zoo.R:99

str.zoo untypeabletyped

unbound variable (line 105)
unbound: NROW — a name the prelude does not declare
error detail
name: NROW
gradual mode: typed
((object: any with { frequency: any, any }, ...: any) -> null)<>
timing: 0.041 s
source
str.zoo <- function(object, ...)
{
  cls <- if(inherits(object, "zooreg")) "zooreg" else "zoo"
  if(NROW(object) < 1) cat(paste(sQuote(cls), "series (without observations)\n")) else {
    cat(paste(sQuote(cls), " series from ", start(object), " to ", end(object), "\n", sep = ""))
    cat("  Data:")
    str(coredata(object), ...)
    cat("  Index: ")
    str(index(object), ...)
    if(cls == "zooreg") cat(paste("  Frequency:", attr(object, "frequency"), "\n"))
  }
}
R/zoo.R:102

[.zoo untypeable

unbound variable (line 118)
unbound: coredata — one of the package’s own names, itself untyped
error detail
name: coredata
timing: 0.252 s
source
"[.zoo" <- function(x, i, j, drop = TRUE, ...)
{
  if(!is.zoo(x)) stop("method is only for zoo objects")
  rval <- coredata(x)
  n <- NROW(rval)
  n2 <- if(nargs() == 1) length(as.vector(rval)) else n
  if(missing(i)) i <- 1:n

  if (inherits(i, "matrix")) i <- as.vector(i)
  ## also support that i can be index:
  ## if i is not numeric/integer/logical, it is interpreted to be the index
  if (inherits(i, "logical"))
    i <- which(rep(i, length.out = n2))
  else if (inherits(i, "zoo") && inherits(coredata(i), "logical")) {
    i <- which(coredata(merge(zoo(,time(x)), i)))
  } else if(!((inherits(i, "numeric") || inherits(i, "integer")))) 
    i <- which(MATCH(index(x), i, nomatch = 0L) > 0L)
  
  if(length(dim(rval)) == 2) {
    drop. <- if (length(i) == 1) FALSE else drop
    rval <- if (missing(j)) rval[i, , drop = drop., ...]
      else rval[i, j, drop = drop., ...]
    if (drop && length(rval) == 1) rval <- c(rval)
    rval <- zoo(rval, index(x)[i])
  } else
    rval <- zoo(rval[i], index(x)[i])

  attr(rval, "oclass") <- attr(x, "oclass")
  attr(rval, "levels") <- attr(x, "levels")
  attr(rval, "frequency") <- attr(x, "frequency")
  if(!is.null(attr(rval, "frequency"))) class(rval) <- c("zooreg", class(rval))

  return(rval)
}
R/zoo.R:115

[<-.zoo untypeable

unbound variable (line 153)
unbound: NextMethod — a name the prelude does not declare
error detail
name: NextMethod
timing: 0.229 s
source
"[<-.zoo" <- function (x, i, j, value) 
{
  ## x[,j] <- value and x[] <- value can be handled by default method
  if(missing(i)) return(NextMethod("[<-"))

  ## otherwise do the necessary processing on i
  n <- NROW(coredata(x))
  n2 <- if(nargs() == 1) length(as.vector(coredata(x))) else n
  n.ok <- TRUE
  value2 <- NULL
  
  if (inherits(i, "matrix")) i <- as.vector(i)
  if (inherits(i, "logical")) {
    if (length(i) == n) {
		i <- which(i)
		n.ok <- TRUE
	} else {
		i <- which(rep(i, length.out = n))
		n.ok <- all(i <= n2)
	}
  } else if (inherits(i, "zoo") && inherits(coredata(i), "logical")) {
    i <- which(coredata(merge(zoo(,time(x)), i)))
    n.ok <- all(i <= n2)
  } else if(!((inherits(i, "numeric") || inherits(i, "integer")))) {
    ## all time indexes in index(x)?
    i.ok <- MATCH(i, index(x), nomatch = 0L) > 0L
    if(any(!i.ok)) {
      if(is.null(dim(value))) {
        value2 <- value[!i.ok]
        value <- value[i.ok]
      } else {
        value2 <- value[!i.ok,, drop = FALSE]
        value <- value[i.ok,, drop = FALSE]      
      }
      i2 <- i[!i.ok]
      i <- i[i.ok]
    }
    i <- which(MATCH(index(x), i, nomatch = 0L) > 0L)
    n.ok <- all(i <= n2)
  }
  if(!n.ok | any(i < 1)) stop("Out-of-range assignment not possible.")
  rval <- NextMethod("[<-")

  if(!is.null(value2)) {
    rval2 <- if(missing(j)) zoo(value2, i2) else {
      value2a <- matrix(NA, nrow = length(i2), ncol = NCOL(rval))
      colnames(value2a) <- colnames(rval)
      value2a[, j] <- value2
      zoo(value2a, i2)
    }
    rval <- c(rval, rval2)
  }
  return(rval)
}
R/zoo.R:150

.DollarNames.zoo untypeabletyped

unbound variable (line 206)
unbound: dimnames — a name the prelude does not declare
error detail
name: dimnames
gradual mode: typed
((x: any, pattern: any?) -> any)<>
timing: 0.360 s
source
.DollarNames.zoo <- function(x, pattern = "") {
  dn <- dimnames(x)
  if(is.null(dn)) {
    character(0)
  } else {
    cn <- dn[[2]]
    if(is.null(cn)) {
      character(0)
    } else {
      grep(pattern, cn, value = TRUE)
    }
  }
}
R/zoo.R:205

$.zoo untypeabletyped

unbound variable (line 221)
unbound: colnames — a name the prelude does not declare
error detail
name: colnames
gradual mode: typed
((object: any, x: any) -> any)<>
timing: 0.061 s
source
"$.zoo" <- function(object, x) {
  if(length(dim(object)) != 2) stop("not possible for univariate zoo series")
  if(is.null(colnames(object))) stop("only possible for zoo series with column names")
  wi <- pmatch(x, colnames(object))
  if(is.na(wi)) NULL else object[, wi]
}
R/zoo.R:219

$<-.zoo untypeabletyped

unbound variable (line 231)
unbound: index — one of the package’s own names, itself untyped
error detail
name: index
gradual mode: typed
((object: any with { frequency: any, any }, x: any, value: any) -> any)<>
timing: 0.182 s
source
"$<-.zoo" <- function(object, x, value) {
  if(length(object) == 0L) {
    is.plain <- function(x)
      all(class(x) %in% c("array", "integer", "numeric", "factor", "matrix", "logical"))
    if(is.plain(value)) value <- zoo(value,
      if(length(index(object))) index(object) else seq_along(value), attr(object, "frequency"))
    return(setNames(merge(object, value, drop = FALSE), x))
  }
  if(length(dim(object)) != 2) stop("not possible for univariate zoo series")
  if(NCOL(object) > 0L && is.null(cnam <- colnames(object))) stop("only possible for zoo series with column names")
  wi <- match(x, cnam)
  if(is.na(wi)) {
    if(!is.null(value)) {
      object <- cbind(object, value)
      if(is.null(dim(object))) dim(object) <- c(length(object), 1)
      if(!identical(colnames(object), cnam)) colnames(object)[NCOL(object)] <- x  
    }
  } else {
    if(is.null(value)) {
      object <- object[, -wi, drop = FALSE]
    } else {   
      object[, wi] <- value
    }
  }
  object
}
R/zoo.R:226

head.zoo untypeabletyped

unbound variable (line 255)
unbound: NROW — a name the prelude does not declare
error detail
name: NROW
gradual mode: typed
((x: any, n: vec?, ...: any) -> any)<>
timing: 0.041 s
source
head.zoo <- function(x, n = 6, ...) {
	stopifnot(length(n) == 1L)
	xlen <- NROW(x)
    n <- if (n < 0L) 
        max(NROW(x) + n, 0L)
    else min(n, xlen)
	if (length(dim(x)) == 0) x[seq_len(n)]
	else x[seq_len(n),, drop = FALSE]
}
R/zoo.R:253

tail.zoo untypeabletyped

unbound variable (line 265)
unbound: NROW — a name the prelude does not declare
error detail
name: NROW
gradual mode: typed
((x: any, n: vec?, ...: any) -> any)<>
timing: 0.040 s
source
tail.zoo <- function(x, n = 6, ...) {
    stopifnot(length(n) == 1L)
    xlen <- NROW(x)
    n <- if (n < 0L) 
        max(xlen + n, 0L)
    else min(n, xlen)
	if (length(dim(x)) == 0) x[seq.int(to = xlen, length.out = n)]
	else x[seq.int(to = xlen, length.out = n),, drop = FALSE]
}
R/zoo.R:263

range.zoo untypeabletyped

unbound variable (line 274)
unbound: coredata — one of the package’s own names, itself untyped
error detail
name: coredata
gradual mode: typed
((...: absent, na.rm: any?) -> empty)<>
timing: 0.016 s
source
range.zoo <- function(..., na.rm = FALSE)
    range(sapply(list(...), coredata), na.rm = na.rm)
R/zoo.R:273

scale.zoo untypeable

unbound variable (line 278)
unbound: coredata — one of the package’s own names, itself untyped
error detail
name: coredata
timing: 0.040 s
source
scale.zoo <- function (x, center = TRUE, scale = TRUE) {
	x[] <- xs <- scale(coredata(x), center = center, scale = scale)
	attributes(x) <- c(attributes(x), attributes(xs))
	x
}
R/zoo.R:277

with.zoo untypeabletyped

unbound variable (line 285)
unbound: substitute — a name the prelude does not declare
error detail
name: substitute
gradual mode: typed
((data: any, expr: any, ...: any) -> any)<>
timing: 0.066 s
source
with.zoo <- function(data, expr, ...) {
    stopifnot(length(dim(data)) == 2)
    eval(substitute(expr), as.list(data), enclos = parent.frame())
}
R/zoo.R:283

xtfrm.zoo untypeabletyped

unbound variable (line 288)
unbound: coredata — one of the package’s own names, itself untyped
error detail
name: coredata
gradual mode: typed
((x: any) -> any)<>
timing: 0.002 s
source
xtfrm.zoo <- function(x) coredata(x)
R/zoo.R:288

subset.zoo untypeable

untypeable application of base::: (line 295)
error detail
argument: @(1.<>, INT1<> | null)
failing call: base:::(1, NULL)
timing: 0.172 s
source
subset.zoo <- function (x, subset, select, drop = FALSE, ...) 
{
    if (missing(select)) 
        vars <- TRUE
    else {
        nl <- as.list(1:ncol(x))
        names(nl) <- colnames(x)
        vars <- eval(substitute(select), nl, parent.frame())
    }
    if (missing(subset)) {
        subset <- rep(TRUE, NROW(x))
    } else {
        e <- substitute(subset)
	if("time" %in% colnames(x)) {
	  xdf <- as.data.frame(x)
          subset <- eval(e, xdf, parent.frame())
          xdf$time <- time(x)
          subset2 <- eval(e, xdf, parent.frame())
	  if(!identical(subset, subset2))
  	      warning("'time' is a column in 'x' (not the time index)")
	} else {
          subset <- eval(e, cbind(as.data.frame(x), time = time(x)), parent.frame())
	}
        if (!is.logical(subset)) stop("'subset' must be logical")
    }
    x[subset & !is.na(subset), vars, drop = drop]
}
R/zoo.R:290

names.zoo untypeabletyped

unbound variable (line 319)
unbound: coredata — one of the package’s own names, itself untyped
error detail
name: coredata
gradual mode: typed
((x: any) -> any)<>
timing: 0.005 s
source
names.zoo <- function(x) {
  cx <- coredata(x)
  if(is.matrix(cx)) colnames(cx) else names(cx)
}
R/zoo.R:318

names<-.zoo untypeable

unbound variable (line 324)
unbound: coredata — one of the package’s own names, itself untyped
error detail
name: coredata
timing: 0.011 s
source
"names<-.zoo" <- function(x, value) {
  if(is.matrix(coredata(x))) {
    colnames(x) <- value
  } else {
    names(coredata(x)) <- value
  }
  x
}
R/zoo.R:323

rev.zoo untypeabletyped

unbound variable (line 333)
unbound: time — a name the prelude does not declare
error detail
name: time
gradual mode: typed
((x: any) -> any)<>
timing: 0.005 s
source
rev.zoo <- function(x) {
  ix <- rev(ORDER(time(x)))
  zoo(coredata(x), time(x)[ix])
}
R/zoo.R:332

ifelse.zoo untypeabletyped

unbound variable (line 338)
unbound: index — one of the package’s own names, itself untyped
error detail
name: index
gradual mode: typed
((test: any, yes: any, no: any) -> any)<>
timing: 0.046 s
source
ifelse.zoo <- function(test, yes, no) {
	if(!is.zoo(test)) test <- zoo(test, index(yes))
	merge(test, yes, no, retclass = NULL)
	ifelse(test, yes, no)
}
R/zoo.R:337

mean.zoo untypeabletyped

unbound variable (line 343)
unbound: coredata — one of the package’s own names, itself untyped
error detail
name: coredata
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.004 s
source
mean.zoo <- function(x, ...)  mean(coredata(x), ...)
R/zoo.R:343

median.zoo untypeabletyped

unbound variable (line 345)
unbound: getRversion — a name the prelude does not declare
error detail
name: getRversion
gradual mode: typed
((x: any, na.rm: any?) -> any)<> | ((x: any, na.rm: any?, ...: any) -> any)<>
timing: 0.016 s
source
median.zoo <- if(getRversion() <= "3.3.3") {
  function(x, na.rm = FALSE) median(coredata(x), na.rm = na.rm)
} else {
  function(x, na.rm = FALSE, ...) median(coredata(x), na.rm = na.rm, ...)
}
R/zoo.R:345

quantile.zoo untypeabletyped

unbound variable (line 351)
unbound: coredata — one of the package’s own names, itself untyped
error detail
name: coredata
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.004 s
source
quantile.zoo <- function(x, ...) quantile(coredata(x), ...)
R/zoo.R:351

transform.zoo untypeabletyped

unbound variable (line 356)
unbound: coredata — one of the package’s own names, itself untyped
error detail
name: coredata
gradual mode: typed
((_data: any, ...: any) -> any)<>
timing: 0.043 s
source
transform.zoo <- function(`_data`, ...)
{
  ## turn zoo matrix into a list of zoo series
  if (is.null(dim(coredata(`_data`)))) warning("transform() is only useful for matrix-based zoo series")
  `_data` <- as.list(`_data`)
  
  ## evaluate transformations
  e <- eval(substitute(list(...)), `_data`, parent.frame())

  ## zoo series that are replaced
  inx <- match(names(e), names(`_data`))
  matched <- !is.na(inx)
  if (any(matched)) `_data`[inx[matched]] <- e[matched]

  ## merge zoo series (including those that are added)
  z <- do.call("merge", c(`_data`, e[!matched]))

  ## always return a zoo matrix (even if just one column)
  if(is.null(dim(coredata(z)))) {
    dim(z) <- c(length(z), 1L)
    names(z) <- names(e)
  }
  return(z)
}
R/zoo.R:353

dim<-.zoo untypeabletyped

unbound variable (line 381)
unbound: all.equal — a name the prelude does not declare
error detail
name: all.equal
gradual mode: typed
((x: any, value: null) | (x: any, value: ~null) -> any)<>
timing: 0.437 s
source
`dim<-.zoo` <- function(x, value) {
  d <- dim(x)
  l <- length(x)
  ok <- isTRUE(all.equal(d, value)) ||                                  ## no change
    (is.null(d) && l == 0L && all(value == c(length(index(x)), 0L))) || ## zero-length vector -> 0-column matrix
    (is.null(d) && l > 0L && all(value == c(l, 1L))) ||                 ## positive-length vector -> 1-column matrix
    (!is.null(d) && d[2L] <= 1L && is.null(value))                      ## 0- or 1-column matrix -> vector
  if(!ok) warning("setting this dimension may lead to an invalid zoo object")
  NextMethod()
}
R/zoo.R:378
R/is.regular.R

is.regular untypeabletyped

unbound variable (line 2)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, strict: any?) -> any)<>
timing: 0.005 s
source
is.regular <- function(x, strict = FALSE) {
  UseMethod("is.regular")
}
R/is.regular.R:1

is.regular.zoo untypeable

unbound variable (line 7)
unbound: index — one of the package’s own names, itself untyped
error detail
name: index
timing: 0.072 s
source
is.regular.zoo <- function(x, strict = FALSE)
{
  delta <- suppressWarnings(try(diff(as.numeric(index(x))), silent = TRUE))
  if(inherits(delta, "try-error") || anyNA(delta)) FALSE
  else if(length(delta) < 1) FALSE
  else if(strict) identical(all.equal(delta, rep.int(delta[1], length(delta))), TRUE)
  else {
    delta <- unique(delta)
    rval <- identical(all.equal(delta/min(delta), round(delta/min(delta))), TRUE)
    if(!rval && identical(all.equal(delta, round(delta)), TRUE)) rval <- TRUE
    rval
  }
}
R/is.regular.R:5

is.regular.ts typed any: x, strict accepts outside

((x: any, strict: any?) -> tt<>)<>
timing: 0.016 s
fuzzing: 8 inside (8 ok) · 8 outside (6 rejected, 2 accepted)

Accepted outside the domain x: 2

parameterchangecallreturned
xdropis.regular.ts("strict" = as.name("x"))tt<> with { }
xdropis.regular.ts()tt<> with { }
source
is.regular.ts <- function(x, strict = FALSE) TRUE
R/is.regular.R:19

is.regular.zooreg typed any: x accepts outside

((x: any, strict: ff?) -> tt<>)<>
gradual mode: typed
(((x: any, strict: any?) -> any)&((x: any, strict: ff?) -> tt<>))<>
timing: 0.034 s
fuzzing: 6 inside (6 ok) · 8 outside (5 rejected, 3 accepted)

Accepted outside the domain strict: 2, x: 1

parameterchangecallreturned
strictretype:lgl>rawis.regular.zooreg(quote(f(x)), as.raw(c(255)))tt<> with { }
strictretype:lgl>rawis.regular.zooreg("x" = c(complex(real = 0, imaginary = 0), complex(real = 0, imaginary = 0)), "strict" = as.raw(c(255)))tt<> with { }
xdropis.regular.zooreg()tt<> with { }
source
is.regular.zooreg <- function(x, strict = FALSE)
{
  if(strict) is.regular.zoo(x, strict = TRUE) else TRUE
}
R/is.regular.R:21

is.regular.default untypeabletyped

unbound variable (line 27)
unbound: as.zoo — one of the package’s own names, itself untyped
error detail
name: as.zoo
gradual mode: typed
((x: any, strict: any?) -> any)<>
timing: 0.006 s
source
is.regular.default <- function(x, strict = FALSE) {
  is.regular(as.zoo(x), strict = strict)
}
R/is.regular.R:26

frequency.zooreg typed accepts outside

∀'a. ((x: any with { frequency: 'a, any }, ...: any) -> 'a)<>
timing: 0.028 s
fuzzing: 20 inside (20 ok) · 8 outside (8 accepted)
type drawn from: ((x: any with { frequency: 'I4796, any }, ...: any) -> 'I4796)<>

Accepted outside the domain x: 8

parameterchangecallreturned
xattr:drop:frequencyfrequency.zooreg("x" = quote(f(x)), "fuzz_dot1" = as.name("x"), "fuzz_dot2" = new.env())null
xattr:drop:frequencyfrequency.zooreg("x" = c(-2.5, 42, 0, Inf, Inf), "fuzz_dot1" = complex(real = 0, imaginary = 0))null
xattr:drop:frequencyfrequency.zooreg(function(...) as.name("x"), NULL)null
xattr:drop:frequencyfrequency.zooreg("x" = c("NA", "x y", "x y", "", "é"), "fuzz_dot1" = NULL)null
xkind:chrfrequency.zooreg("fuzz")null
xkind:funfrequency.zooreg(function(...) NULL, list())null
and 2 more
source
frequency.zooreg <- function(x, ...) 
{
  attr(x, "frequency")
}
R/is.regular.R:30

frequency.zoo typed accepts outside

∀'a. ((x: any with { frequency: 'a \ null, any }, ...: any) -> 'a)<>
timing: 0.398 s
fuzzing: 20 inside (20 ok) · 8 outside (8 accepted)
type drawn from: ((x: any with { frequency: 'I4911 \ null, any }, ...: any) -> 'I4911)<>

Accepted outside the domain x: 8

parameterchangecallreturned
xattr:drop:frequencyfrequency.zoo("x" = new.env())null
xattr:drop:frequencyfrequency.zoo(list(), function(...) new.env(), function(...) quote(f(x)))null
xkind:chrfrequency.zoo("x" = "fuzz", "fuzz_dot1" = list(), "fuzz_dot2" = quote(f(x)))null
xkind:funfrequency.zoo("x" = function(...) NULL, "fuzz_dot1" = function(...) quote(f(x)), "fuzz_dot2" = function(...) as.name("x"))null
xkind:funfrequency.zoo(function(...) NULL, NULL, "fuzz_dot1" = NULL, "fuzz_dot2" = new.env())null
xwrapfrequency.zoo(list(structure(function(...) 0.5, "frequency" = c(NA_real_, NaN, 2147483647, 2147483647, -Inf))), new.env(), as.name("x"), "fuzz_dot1" = quote(f(x)))null
and 2 more
source
frequency.zoo <- function(x, ...)
{
  ## check whether frequency is available
  freq <- attr(x, "frequency")
  if(!is.null(freq) || length(index(x)) < 2) return(freq)

  ## check regularity
  delta <- suppressWarnings(try(diff(as.numeric(index(x))), silent = TRUE))
  reg <- if(inherits(delta, "try-error") || anyNA(delta)) FALSE
  else {
    delta <- unique(delta)
    rval <- identical(all.equal(delta/min(delta), round(delta/min(delta))), TRUE)
    if(rval) freq <- 1/min(delta)
    else if(identical(all.equal(delta, round(delta)), TRUE)) {
      ## special case: integer indexes
      ## get frequency as greatest common divisor (of differences)
      gcd <- function(x) {	
        gcd0 <- function(a, b) ifelse(b==0 | a==b, a, gcd0(b, a %% b))
        if(length(x) < 2) x <- c(x, as.integer(0))
        if(length(x) < 3) {
          return(gcd0(x[1], x[2]))
        } else {
          x <- sapply(1:(length(x) - 1), function(i) gcd0(x[i], x[i+1]))
          gcd(x)
        }
      }
      freq <- 1/gcd(delta)
      rval <- TRUE
    }
    rval
  }
  if(!reg) return(NULL)
  if(freq > 1 && identical(all.equal(freq, round(freq)), TRUE)) freq <- round(freq)
  return(freq)
}
R/is.regular.R:35

frequency<- untypeabletyped

unbound variable (line 72)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, value: any) -> any)<>
timing: 0.004 s
source
"frequency<-" <- function(x, value)
  UseMethod("frequency<-")
R/is.regular.R:71

frequency<-.zoo untypeable

unbound variable (line 75)
unbound: index — one of the package’s own names, itself untyped
error detail
name: index
timing: 0.069 s
source
"frequency<-.zoo" <- function(x, value) {
  delta <- suppressWarnings(try(diff(as.numeric(index(x))), silent = TRUE))
  freqOK <- if(inherits(delta, "try-error") || anyNA(delta)) FALSE
    else if(length(delta) < 1) TRUE
    else identical(all.equal(delta*value, round(delta*value)), TRUE)
  stopifnot(freqOK)
  if(value > 1 && identical(all.equal(value, round(value)), TRUE)) value <- round(value)
  attr(x, "frequency") <- value
  class(x) <- c("zooreg", "zoo")
  return(x)
}
R/is.regular.R:74

frequency<-.zooreg untypeable

unbound variable (line 87)
unbound: index — one of the package’s own names, itself untyped
error detail
name: index
timing: 0.015 s
source
"frequency<-.zooreg" <- function(x, value) {
  delta <- diff(as.numeric(index(x)))
  stopifnot(identical(all.equal(delta*value, round(delta*value)), TRUE))
  attr(x, "frequency") <- value
  return(x)
}
R/is.regular.R:86

deltat.zoo typed accepts outside

∀`a. (((x: any with { frequency: dbl1<. | `a>, any }, ...: any) -> DBL1<. | `a>)&((x: any with { frequency: dbl<. | `a>, any }, ...: any) -> DBL<. | `a>))<>
timing: 0.273 s
fuzzing: 20 inside (14 ok, 6 error type) · 8 outside (1 rejected, 7 accepted)
type drawn from: (((x: any with { frequency: dbl1<. | `I357>, any }, ...: any) -> DBL1<. | `I357>) & ((x: any with { frequency: dbl<. | `I357>, any }, ...: any) -> DBL<. | `I357>))<>

Accepted outside the domain x: 7

parameterchangecallreturned
xattr:drop:frequencydeltat.zoo("x" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))null
xdropdeltat.zoo(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "fuzz_dot1" = NULL)null
xdropdeltat.zoo(as.name("x"), 0L, "fuzz_dot1" = function(...) NULL, "fuzz_dot2" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))null
xkind:dbldeltat.zoo("x" = 1.5, "fuzz_dot1" = c(NA_character_, NA_character_, "", "x y", "NA"))null
xkind:envdeltat.zoo(new.env(), as.raw(c(0, 255, 0, 0, 255)), NULL, "fuzz_dot1" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))null
xkind:nulldeltat.zoo(NULL, character(0), "fuzz_dot1" = new.env(), "fuzz_dot2" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))null
and 1 more

Other calls inside the domain

callverdicterror
deltat.zoo("x" = structure(quote(f(x)), "frequency" = as.raw(c(255))), "fuzz_dot1" = NULL)error_typebase::/: non-numeric argument to binary operator
deltat.zoo(structure(TRUE, "frequency" = as.raw(c(255))), character(0), "fuzz_dot1" = new.env(), "fuzz_dot2" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_typebase::/: non-numeric argument to binary operator
deltat.zoo(structure(new.env(), "frequency" = as.raw(c(255))), as.name("x"), 0L, "fuzz_dot1" = function(...) NULL, "fuzz_dot2" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))error_typebase::/: non-numeric argument to binary operator
deltat.zoo("x" = structure(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "frequency" = as.raw(c(255))))error_typebase::/: non-numeric argument to binary operator
deltat.zoo("x" = structure(function(...) as.name("x"), "frequency" = raw(0)), "fuzz_dot1" = as.name("x"), "fuzz_dot2" = integer(0))error_typebase::/: non-numeric argument to binary operator
deltat.zoo("x" = structure(function(...) list(NULL, function(...) raw(0)), "frequency" = raw(0)), "fuzz_dot1" = list(local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p })))error_typebase::/: non-numeric argument to binary operator
source
deltat.zoo <- function(x, ...)
{
  rval <- frequency.zoo(x, ...)
  if(is.null(rval)) NULL else 1/rval
}
R/is.regular.R:93

deltat.zooreg typed accepts outside

∀`a. (((x: any with { frequency: dbl1<. | `a>, any }, ...: any) -> DBL1<. | `a>)&((x: any with { frequency: dbl<. | `a>, any }, ...: any) -> DBL<. | `a>))<>
timing: 0.261 s
fuzzing: 20 inside (17 ok, 3 error type) · 8 outside (2 rejected, 6 accepted)
type drawn from: (((x: any with { frequency: dbl1<. | `I361>, any }, ...: any) -> DBL1<. | `I361>) & ((x: any with { frequency: dbl<. | `I361>, any }, ...: any) -> DBL<. | `I361>))<>

Accepted outside the domain x: 6

parameterchangecallreturned
xattr:drop:frequencydeltat.zooreg("x" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))(DBL & ~vec1)<> with { }
xattr:drop:frequencydeltat.zooreg("x" = function(...) NULL, "fuzz_dot1" = as.name("x"), "fuzz_dot2" = function(...) list(as.name("x"), as.name("x")))(DBL & ~vec1)<> with { }
xattr:drop:frequencydeltat.zooreg(quote(f(x)), c(-1, 1, -1, 42, 42))(DBL & ~vec1)<> with { }
xkind:langdeltat.zooreg("x" = quote(f(x)), "fuzz_dot1" = new.env(), "fuzz_dot2" = NULL)(DBL & ~vec1)<> with { }
xwrapdeltat.zooreg(list(structure(quote(f(x)), "frequency" = TRUE)), 0, "fuzz_dot1" = list(as.raw(c(255))), "fuzz_dot2" = as.name("x"))(DBL & ~vec1)<> with { }
xwrapdeltat.zooreg(list(structure(list(), "frequency" = 42L)), "fuzz_dot1" = local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }))(DBL & ~vec1)<> with { }

Other calls inside the domain

callverdicterror
deltat.zooreg(structure(quote(f(x)), "frequency" = as.raw(c(255, 255))), c(-1, 1, -1, 42, 42))error_typebase::/: non-numeric argument to binary operator
deltat.zooreg("x" = structure(function(...) local({ p <- unserialize(serialize(new("externalptr"), NULL)); attributes(p) <- NULL; p }), "frequency" = as.raw(c(255))), "fuzz_dot1" = quote(f(x)), "fuzz_dot2" = function(...) as.name("x"))error_typebase::/: non-numeric argument to binary operator
deltat.zooreg("x" = structure(list(NULL), "frequency" = as.raw(c(255, 0, 0, 255, 0))), "fuzz_dot1" = as.raw(c(255)))error_typebase::/: non-numeric argument to binary operator
source
deltat.zooreg <- function(x, ...)
{
  1/frequency.zooreg(x, ...)
}
R/is.regular.R:99

cycle.zooreg skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.000 s
source
cycle.zooreg <- function(x, ...)
{
  freq <- frequency(x)
  ix <- as.numeric(index(x))
  d <- diff(ix)
  if(!identical(all.equal(freq*d, round(freq*d)), TRUE))
    stop(paste(sQuote("cycle"), "not available for", sQuote("x")))  
  return(zoo(round((ix - floor(ix)) * freq) + 1, order.by = index(x), freq))
}
R/is.regular.R:104

cycle.zoo untypeabletyped

unbound variable (line 116)
unbound: is.regular — one of the package’s own names, itself untyped
error detail
name: is.regular
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.007 s
source
cycle.zoo <- function(x, ...)
{
  if(is.regular(x)) cycle.zooreg(x)
    else stop(sQuote("x"), "is not regular")
}
R/is.regular.R:114
R/zooreg.R

zooreg untypeable

untypeable application of base::< (line 8)
error detail
argument: @((dbl & ~lgl)<~@"-", . | `I372> & dbl1<~@"-", . | `I372>, null | 'ts.eps)
failing call: base::<(NA_integer_, NULL)
timing: 4.15 s
source
zooreg <- function(data, start = 1, end = numeric(), frequency = 1, 
  deltat = 1, ts.eps = getOption("ts.eps"), order.by = NULL,
  calendar = getOption("zoo.calendar", TRUE))
{
    ## choose frequency/deltat
    if (missing(frequency)) frequency <- 1/deltat
    	else if(missing(deltat)) deltat <- 1/frequency
    if (frequency > 1 && abs(frequency - round(frequency)) < ts.eps)
    	frequency <- round(frequency)

    ## detect if integer index is intended
    intgr <- ((length(start) < 1L) || is.integer(start)) && ((length(end) < 1L) || is.integer(end))

    ## check data and choose default
    if (missing(data) || is.null(data)) data <- NA
    if(!(is.vector(data) || is.factor(data) || is.atomic(data) || is.matrix(data) || is.data.frame(data)))
      stop(paste(dQuote("data"), ": attempt to define invalid zoo object"))
    if(is.matrix(data) || is.data.frame(data)) data <- as.matrix(data)

    ## if no index (i.e., order.by) is specified: behave as ts()
    ## else: behave as zoo()
    if (is.null(order.by)) {
	if(!any(c(is.vector(data), is.factor(data), is.atomic(data), is.matrix(data), is.data.frame(data))))
  	    stop(paste(dQuote("data"), ": attempt to define invalid zoo object"))
	ndata <- NROW(data)        

        ## convenience function
        numORint <- function(x) identical(class(x), "numeric") || identical(class(x), "integer")

        ## choose start/end
        if (length(start) > 1) start <- start[1] + (start[2] - 1)/frequency
        if (length(end) > 1) end <- end[1] + (end[2] - 1)/frequency
        if (missing(end)) {
	  ostart <- start
	  oend <- NULL
	  start <- as.numeric(start)	  
	  end <- start + (ndata - 1)/frequency
	} else if(missing(start)) {
	  ostart <- NULL
	  oend <- end
	  end <- as.numeric(end)
	  start <- end - (ndata - 1)/frequency
	} else{
	  ostart <- start
	  oend <- NULL
	  start <- as.numeric(start)
	  end <- as.numeric(end)
	}
        if (start > end) stop("start cannot be after end")

        ## check whether lengths of data and index match
	# wrong lengths sometimes: order.by <- seq(start, end, by = deltat)
	order.by <- start + seq(0, length.out = ndata) * deltat
	if(isTRUE(all.equal(start * frequency, round(start * frequency), tolerance = ts.eps^2))) {
	  order.by <- floor(frequency * order.by + .0001)/frequency
        }
	
	## support also non-numeric indexes
	if(!is.null(ostart) && !numORint(ostart))
	  order.by <- ostart + (order.by - start)
	if(!is.null(oend) && !numORint(oend))
	  order.by <- oend + (order.by - end)
	
	nobs <- length(order.by)
        ## nobs <- floor((end - start) * frequency + 1.01)
        if (nobs != ndata) {
	  if(is.vector(data)) data <- rep(data, length.out = nobs)
	  else if(is.factor(data)) data <- factor(rep(as.character(data), length.out = nobs), labels = levels(data))
	  else if(is.matrix(data) || is.data.frame(data)) data <- data[rep(1:ndata, length.out = nobs), , drop = FALSE]
        }
 
	## support of calendar index (yearqtr/yearmon) for quarterly/monthly data
	if(calendar && frequency %in% c(4, 12) && numORint(order.by)) {
	  order.by <- if(frequency == 4) as.yearqtr(order.by) else as.yearmon(order.by)
	} else if(intgr) {
	  if(isTRUE(all.equal(order.by, round(order.by), tolerance = ts.eps^2))) order.by <- as.integer(round(order.by))
	}
	
        attr(data, "oclass") <- attr(data, "class")
        attr(data, "index") <- order.by
        attr(data, "frequency") <- frequency
        class(data) <- c("zooreg", "zoo")
        return(data)
    } else {
        return(zoo(data, order.by, frequency))
    }
}
R/zooreg.R:1

rev.zooreg untypeabletyped

unbound variable (line 89)
unbound: as.zoo — one of the package’s own names, itself untyped
error detail
name: as.zoo
gradual mode: typed
((x: any) -> any)<>
timing: 0.003 s
source
rev.zooreg <- function(x) { z <- as.zooreg(rev(as.zoo(x))); frequency(z) <- frequency(x); z }
R/zooreg.R:89
R/as.zoo.R

as.zoo untypeabletyped

unbound variable (line 3)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.003 s
source
as.zoo <- function(x, ...)
{
  UseMethod("as.zoo")
}
R/as.zoo.R:1

as.zoo.default untypeabletyped

unbound variable (line 8)
unbound: index — one of the package’s own names, itself untyped
error detail
name: index
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.210 s
source
as.zoo.default <- function(x, ...)
{
  zoo(structure(x, dim = dim(x)), index(x), ...)
}
R/as.zoo.R:6

as.zoo.factor untypeabletyped

unbound variable (line 13)
unbound: zoo — one of the package’s own names, itself untyped
error detail
name: zoo
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.004 s
source
as.zoo.factor <- function(x, ...) 
{
  zoo(x, ...)
}
R/as.zoo.R:11

as.zoo.matrix untypeabletyped

unbound variable (line 18)
unbound: zoo — one of the package’s own names, itself untyped
error detail
name: zoo
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.004 s
source
as.zoo.matrix <- function(x, ...) 
{
  zoo(x, ...)
}
R/as.zoo.R:16

as.zoo.data.frame untypeabletyped

unbound variable (line 23)
unbound: as.matrix — a name the prelude does not declare
error detail
name: as.matrix
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.004 s
source
as.zoo.data.frame <- function(x, ...) 
{
  zoo(as.matrix(x), ...)
}
R/as.zoo.R:21

as.zoo.fts untypeabletyped

unbound variable (line 28)
unbound: as.matrix — a name the prelude does not declare
error detail
name: as.matrix
gradual mode: typed
((x: any with { dates: any, any }, ...: any) -> any)<>
timing: 0.004 s
source
as.zoo.fts <- function(x, ...) 
{
	zoo(as.matrix(x), attr(x, "dates"))
}
R/as.zoo.R:26

as.zoo.irts untypeabletyped

unbound variable (line 33)
unbound: zoo — one of the package’s own names, itself untyped
error detail
name: zoo
gradual mode: typed
((x: { value: any, time: any, any }, ...: any) -> any)<>
timing: 0.037 s
source
as.zoo.irts <- function(x, ...)
{
  zoo(x$value, x$time, ...)
}
R/as.zoo.R:31

as.zoo.its untypeable

unbound variable (line 39)
unbound: attr<- — a name the prelude does not declare
error detail
name: attr<-
timing: 0.025 s
source
as.zoo.its <- function(x, ...) 
{
	index <- attr(x, "dates")
	class(x) <- attr(x, "dates") <- NULL
	zoo(x, index, ...)
}
R/as.zoo.R:36

as.zoo.mcmc untypeabletyped

unbound variable (line 46)
unbound: as.ts — a name the prelude does not declare
error detail
name: as.ts
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.005 s
source
as.zoo.mcmc <- function(x, ...)
{
	as.zoo(as.ts(x, ...))
}
R/as.zoo.R:44

as.zoo.timeSeries untypeabletyped

unbound variable (line 50)
unbound: as.matrix — a name the prelude does not declare
error detail
name: as.matrix
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.004 s
source
as.zoo.timeSeries <- function(x, ...) {
  zoo(as.matrix(x), time(x), ...)  
}
R/as.zoo.R:49

as.zoo.xts untypeabletyped

unbound variable (line 54)
unbound: coredata — one of the package’s own names, itself untyped
error detail
name: coredata
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.031 s
source
as.zoo.xts <- function(x, ...) {
  y <- coredata(x)
  if (is.null(dim(y)) && length(y) == 0) {
    y <- NULL
  }
  zoo(y, order.by = index(x), ...)
}
R/as.zoo.R:53

as.zooreg untypeabletyped

unbound variable (line 129)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, frequency: any?, ...: any) -> any)<>
timing: 0.007 s
source
as.zooreg <- function(x, frequency = NULL, ...)
{
  UseMethod("as.zooreg")
}
R/as.zoo.R:127

as.zooreg.xts untypeabletyped

unbound variable (line 62)
unbound: as.zoo — one of the package’s own names, itself untyped
error detail
name: as.zoo
gradual mode: typed
((x: any, frequency: any?, ...: any) -> any)<>
timing: 0.009 s
source
as.zooreg.xts <- function(x, frequency = NULL, ...) {
  as.zooreg(as.zoo(x, ...), frequency = frequency)
}
R/as.zoo.R:61

as.zoo.zoo typed fuzz ok

∀'a. ((x: 'a, ...: any) -> 'a)<>
timing: 0.009 s
fuzzing: 20 inside (20 ok) · 8 outside (8 rejected)
type drawn from: ((x: 'x, ...: any) -> 'x)<>
source
as.zoo.zoo <- function(x, ...) x
R/as.zoo.R:65

as.vector.zoo untypeabletyped

unbound variable (line 68)
unbound: coredata — one of the package’s own names, itself untyped
error detail
name: coredata
gradual mode: typed
((x: any, mode: any?) -> any)<>
timing: 0.006 s
source
as.vector.zoo <- function(x, mode = "any")
	as.vector(coredata(x), mode = mode)
R/as.zoo.R:67

as.matrix.zoo untypeable

unbound variable (line 72)
unbound: coredata — one of the package’s own names, itself untyped
error detail
name: coredata
timing: 0.162 s
source
as.matrix.zoo <- function(x, ...) 
{
    y <- as.matrix(coredata(x), ...)
    if (identical(coredata(x), numeric(0))) dim (y) <- c(0, 0)
    if (length(y) > 0) {
	    colnames(y) <- if (length(colnames(x)) > 0) 
		colnames(x)
	    else {
		lab <- deparse(substitute(x), width.cutoff = 100L, nlines = 1L)
		if (NCOL(x) == 1) 
		    lab
		else paste(lab, 1:NCOL(x), sep = ".")
	    }
	} else if (nrow(y) != length(index(x))) {
		dim(y) <- c(length(index(x)), 0)
	}
    if (!is.null(y) && nrow(y) > 0 && is.null(row.names(y))) 
		row.names(y) <- index2char(index(x), frequency = attr(x, "frequency"))
    return(y)
}
R/as.zoo.R:70

as.data.frame.zoo untypeabletyped

unbound variable (line 93)
unbound: coredata — one of the package’s own names, itself untyped
error detail
name: coredata
gradual mode: typed
((x: any with { frequency: any, any }, row.names: null?, optional: dbl?, ...: any) -> any)<>
timing: 0.141 s
source
as.data.frame.zoo <- function(x, row.names = NULL, optional = FALSE, ...)
{
	y <- as.data.frame(coredata(x), optional = optional, ...)
        if(NCOL(x) > 0 && !optional) {
		colnames(y) <- if (length(colnames(x)) > 0) 
			colnames(x)
		else {
			lab <- deparse(substitute(x), width.cutoff = 100L, nlines = 1L)
			if (NCOL(x) == 1) lab
	                  else paste(lab, 1:NCOL(x), sep = ".")
		}
	}
	if (!is.null(row.names)) row.names(y) <- row.names 
	  else {
	    tmp <- index2char(index(x), frequency = attr(x, "frequency"))
	    if (NROW(y) > 0 && !any(duplicated(tmp))) row.names(y) <- tmp
        }
	return(y)
}
R/as.zoo.R:91

as.list.zoo untypeabletyped

unbound variable (line 113)
unbound: as.data.frame — a name the prelude does not declare
error detail
name: as.data.frame
gradual mode: typed
((x: any with { frequency: any, any }, ...: any) -> any)<>
timing: 0.080 s
source
as.list.zoo <- function(x, ...) {
	if (length(dim(x)) == 0) list(x)
  		else lapply(as.data.frame(x), zoo, index(x),  attr(x, "frequency"))
}
R/as.zoo.R:111

as.list.ts untypeabletyped

unbound variable (line 118)
unbound: as.data.frame — a name the prelude does not declare
error detail
name: as.data.frame
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.012 s
source
as.list.ts <- function(x, ...) {
	if (is.matrix(x))
		lapply(as.data.frame(x), ts, 
			start = start(x), end = end(x), freq = frequency(x))
	else
		list(x)
}
R/as.zoo.R:116

as.zooreg.default untypeabletyped

unbound variable (line 134)
unbound: as.zoo — one of the package’s own names, itself untyped
error detail
name: as.zoo
gradual mode: typed
((x: any, frequency: any?, ...: any) -> any)<>
timing: 0.008 s
source
as.zooreg.default <- function(x, frequency = NULL, ...)
{
  as.zooreg(as.zoo(x, ...), frequency = frequency)
}
R/as.zoo.R:132

as.zooreg.ts untypeable

unbound variable (line 139)
unbound: tsp — a name the prelude does not declare
error detail
name: tsp
timing: 0.034 s
source
as.zooreg.ts <- as.zoo.ts <- function(x, frequency = NULL, ...)
{
  xtsp <- tsp(x)
  if(is.null(frequency)) frequency <- xtsp[3]
  zooreg(coredata(x), start = xtsp[1], end = xtsp[2], frequency = frequency, ...)
} 
R/as.zoo.R:137

as.ts.zooreg untypeable

unbound variable (line 146)
unbound: frequency — a name the prelude does not declare
error detail
name: frequency
timing: 0.041 s
source
as.ts.zooreg <- function(x, ...)
{
  freq <- frequency(x)
  deltat <- 1/freq
  tt <- as.numeric(time(x))
  round. <- if(isTRUE(all.equal(c(deltat, tt), round(c(deltat, tt))))) {
    function(x) floor(x + 0.5)
  } else {
    function(x) deltat * floor(x/deltat + 0.5)
  }
  tt <- round.(tt)
  tt2 <- round.(seq(head(tt,1), tail(tt,1), deltat))
  fill <- list(...)$fill
  if(is.null(fill)) fill <- NA
  xx <- merge(zoo(coredata(x), tt), zoo(, tt2), fill = fill)
  ts(coredata(xx), start = tt[1], frequency = freq)
}
R/as.zoo.R:144

as.ts.zoo untypeabletyped

unbound variable (line 164)
unbound: is.regular — one of the package’s own names, itself untyped
error detail
name: is.regular
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.013 s
source
as.ts.zoo <- function(x, ...)
{
  if(is.regular(x)) {
    attr(x, "frequency") <- frequency(x)
    return(as.ts.zooreg(x, ...))
  } else {
    warning(paste(sQuote("x"), "does not have an underlying regularity"))
    return(ts(coredata(x)))
  }
}
R/as.zoo.R:162

as.zoo.zooreg untypeabletyped

unbound variable (line 174)
unbound: attr<- — a name the prelude does not declare
error detail
name: attr<-
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.006 s
source
as.zoo.zooreg <- function(x, ...) {
  attr(x, "frequency") <- NULL
  class(x) <- "zoo"
  return(x)
}
R/as.zoo.R:173

as.zooreg.zoo untypeabletyped

unbound variable (line 184)
unbound: frequency — a name the prelude does not declare
error detail
name: frequency
gradual mode: typed
((x: any, frequency: null?, ...: any) -> any)<>
timing: 0.096 s
source
as.zooreg.zoo <- function(x, frequency = NULL, ...)
{
  if(!is.null(frequency)) {
    frequency(x) <- frequency
  } else {
    freq <- frequency(x)
    if(!is.null(freq)) {
      attr(x, "frequency") <- freq
      class(x) <- c("zooreg", "zoo")
    } else {
      warning(paste(sQuote("x"), "does not have an underlying regularity"))
      x <- zooreg(coredata(x))
    }
  }
  return(x)
}
R/as.zoo.R:179
R/Ops.zoo.R

Ops.zoo untypeabletimeout

unbound variable (line 4)
unbound: .Generic — a name the prelude does not declare
error detail
name: .Generic
gradual mode: timeout
timing: 12.29 s
source
Ops.zoo <- function (e1, e2) 
{
    e <- if (missing(e2)) {
        NextMethod(.Generic)
    }
    else if (any(nchar(.Method) == 0L)) {
        NextMethod(.Generic)
    }
    else {
	merge(e1, e2, all = FALSE, retclass = NULL)
        NextMethod(.Generic)
    }
    if (is.null(attr(e, "index"))) {
        if(!missing(e2) && nchar(.Method)[1L] == 0L) {
	  out <- zoo(e, index(e2), attr(e2, "frequency"))
	} else {
	  out <- zoo(e, index(e1), attr(e1, "frequency"))
	}
    } else {
	out <- e
    }
    # the next statement is a workaround for a bug in R
    structure(out, class = class(out))
}
R/Ops.zoo.R:1

t.zoo untypeabletyped

unbound variable (line 27)
unbound: as.matrix.zoo — one of the package’s own names, itself untyped
error detail
name: as.matrix.zoo
gradual mode: typed
((x: any) -> any)<>
timing: 0.002 s
source
t.zoo <- function(x)
	t(as.matrix.zoo(x))
R/Ops.zoo.R:26

cumsum.zoo untypeabletyped

unbound variable (line 31)
unbound: coredata — one of the package’s own names, itself untyped
error detail
name: coredata
gradual mode: typed
((x: any) -> any)<>
timing: 0.053 s
source
cumsum.zoo <- function(x) 
{
	if (length(dim(x)) == 0) x[] <- cumsum(coredata(x))
	  else x[] <- apply(coredata(x), 2, cumsum)
	return(x)
}
R/Ops.zoo.R:29

cumprod.zoo untypeabletyped

unbound variable (line 39)
unbound: coredata — one of the package’s own names, itself untyped
error detail
name: coredata
gradual mode: typed
((x: any) -> any)<>
timing: 0.052 s
source
cumprod.zoo <- function(x) 
{
	if (length(dim(x)) == 0) x[] <- cumprod(coredata(x))
	  else x[] <- apply(coredata(x), 2, cumprod)
	return(x)
}
R/Ops.zoo.R:37

cummin.zoo untypeabletyped

unbound variable (line 47)
unbound: coredata — one of the package’s own names, itself untyped
error detail
name: coredata
gradual mode: typed
((x: any) -> any)<>
timing: 0.053 s
source
cummin.zoo <- function(x) 
{
	if (length(dim(x)) == 0) x[] <- cummin(coredata(x))
	  else x[] <- apply(coredata(x), 2, cummin)
	return(x)
}
R/Ops.zoo.R:45

cummax.zoo untypeabletyped

unbound variable (line 55)
unbound: coredata — one of the package’s own names, itself untyped
error detail
name: coredata
gradual mode: typed
((x: any) -> any)<>
timing: 0.056 s
source
cummax.zoo <- function(x) 
{
	if (length(dim(x)) == 0) x[] <- cummax(coredata(x))
	  else x[] <- apply(coredata(x), 2, cummax)
	return(x)
}
R/Ops.zoo.R:53
R/aggregate.zoo.R

aggregate.zoo untypeabletyped

unbound variable (line 5)
unbound: MATCH — one of the package’s own names, itself untyped
error detail
name: MATCH
gradual mode: typed
((x: any, by: @(any) -> empty, FUN: any?, ...: any, regular: any?, frequency: any?, coredata: any?) | (x: any, by: { }<~@"[[", ...>, FUN: any?, ...: any, regular: any?, frequency: any?, coredata: any?) -> empty)<>
timing: 0.213 s
source
aggregate.zoo <- function(x, by, FUN = sum, ..., regular = NULL, frequency = NULL, coredata = TRUE)
{
  ## index processing
  my.unique <- function(x) {
    ix <- MATCH(x, x) == seq_len(length(x))
    x[ix]
  }
  if(is.function(by)) by <- by(index(x))
  if(!is.list(by)) by <- list(by)

  ## sanity checks and option processing
  stopifnot(length(time(x)) == length(by[[1]]))
  if(is.null(frequency)) {
    if(is.null(regular)) regular <- inherits(x, "zooreg")
  } else {
    if(identical(regular, FALSE)) warning(paste(sQuote("regular"), "is ignored"))
    regular <- TRUE
  }

  ## aggregate data
  by_integer <- list(MATCH(by[[1]], by[[1]]))
  if(coredata) {
    df <- coredata(x)
  } else {
    df <- as.data.frame(x)
    if(ncol(df) > 1L) {
      for(i in 1L:ncol(df)) df[[i]] <- x[, i]
    } else {
      df[[1L]] <- x
    }
  }
  df <- aggregate(df, by_integer, match.fun(FUN), ...)
  if(length(unique(as.character(df[,1]))) == length(df[,1]))
      row.names(df) <- df[, 1]
  df <- df[, -1]
  if(is.matrix(x)) df <- as.matrix(df)
  
  ## regularity processing, set up return value
  ix <- my.unique(by[[1]])
  rval <- zoo(df, ix[!is.na(ix)])
  
  if(regular) {
    freq <- ifelse(is.null(frequency), frequency(rval), frequency)
    rval <- zoo(df, ix, freq)
  }
  
  return(rval)
}
R/aggregate.zoo.R:1

split.zoo untypeable

unbound variable (line 52)
unbound: time — a name the prelude does not declare
error detail
name: time
timing: 0.044 s
source
split.zoo <- function(x, f, drop = FALSE, ...) {
    ix <- time(x)
	xc <- coredata(x)
	if (length(dim(xc)) < 2) {
		lapply(split(seq_along(xc), f, drop = drop, ...), 
			function(ind) zoo(xc[ind], ix[ind]))
	} else {
		lapply(split(seq_len(nrow(xc)), f, drop = drop, ...), 
			function(ind) zoo(xc[ind, , drop = drop], ix[ind]))
	}
}
R/aggregate.zoo.R:51
R/as.Date.ts.R

as.Date.ts untypeabletyped

unbound variable (line 5)
unbound: time — a name the prelude does not declare
error detail
name: time
gradual mode: typed
((x: any, offset: any?, ...: any) -> any)<>
timing: 0.053 s
source
as.Date.ts <- function(x, offset = 0, ...) {
   time.x <- unclass(time(x)) + offset
   if (frequency(x) == 1)
	as.Date(paste(time.x, 1, 1, sep = "-"))
   else if (frequency(x) == 4)
	as.Date(paste((time.x + .001) %/% 1, 3*(cycle(x)-1)+1, 1, sep = "-"))
   else if (frequency(x) == 12)
	as.Date(paste((time.x + .001) %/% 1, cycle(x), 1, sep = "-"))
   else
	stop("unable to convert ts time to Date class")
}
R/as.Date.ts.R:4
R/as.zoo.tis.R

as.zoo.tis untypeabletyped

unbound variable (line 3)
unbound: as.zooreg — one of the package’s own names, itself untyped
error detail
name: as.zooreg
gradual mode: typed
((x: any, class: ("numeric" | "ti")?, ...: (absent, any)) | (x: any, class: (~"numeric")?, ...: (absent, any)) -> any)<>
timing: 0.040 s
source
as.zoo.tis <- function(x, class = "ti", ...) {
  if (class == "ti") {
    as.zoo(as.zooreg(x, class = "ti", ...))
  } else if (class == "numeric") {
    zoo(tis::stripTis(x), time(tis::ti(x), offset = 0))
  } else {
    asFun <- paste("as", class, sep = ".")
    zoo(tis::stripTis(x), do.call(asFun, list(tis::POSIXct(tis::ti(x), offset = 0, tz = "GMT"))), ...)
  }
}
R/as.zoo.tis.R:1

as.zooreg.tis untypeabletyped

unbound variable (line 13)
unbound: tis::stripTis — a name the prelude does not declare
error detail
name: tis::stripTis
gradual mode: typed
((x: any, frequency: any?, class: any?, ...: any) -> any)<>
timing: 0.042 s
source
as.zooreg.tis <- function(x, frequency = NULL, class = "ti", ...) {
  if (class == "ti") zooreg(tis::stripTis(x), start = start(x), ...)
    else as.zooreg(as.zoo(x, class = class, ...), frequency = frequency)
}
R/as.zoo.tis.R:12
R/barplot.zoo.R

barplot.zoo untypeable

unbound variable (line 3)
unbound: coredata — one of the package’s own names, itself untyped
error detail
name: coredata
timing: 0.045 s
source
barplot.zoo <- function(height, names.arg = NULL, ...)
{
  x <- coredata(height)
  if(!is.null(dim(x))) x <- t(x)
  if(is.null(names.arg)) names.arg <- index2char(index(height))
  barplot(x, names.arg = names.arg, ...)
}
R/barplot.zoo.R:1

boxplot.zoo untypeabletyped

unbound variable (line 9)
unbound: coredata — one of the package’s own names, itself untyped
error detail
name: coredata
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.004 s
source
boxplot.zoo <- function(x, ...) boxplot(coredata(x), ...)
R/barplot.zoo.R:9
R/ggplot2.zoo.R

fortify.zoo untypeable

unbound variable (line 6)
unbound: NROW — a name the prelude does not declare
error detail
name: NROW
timing: 0.682 s
source
fortify.zoo <- function(model, data, names = c("Index", "Series", "Value"),
		melt = FALSE, sep = NULL, ...)
{
  if (!is.null(sep) && !melt) stop("Cannot specify sep if melt = FALSE")
  ## dimensions
  n <- NROW(model)
  k <- NCOL(model)

  ## dots only named data.frame arguments
  dots <- list(...)
  dots <- dots[names(dots) %in%
    c("row.names", "check.rows", "check.names", "fix.empty.names", "stringsAsFactors")]
  
  ## series labels
  lab <- colnames(model)
  if(is.null(lab)) lab <- rep.int(deparse(substitute(model)), k)
  lab <- make.unique(lab)
  
  ## return data names
  nm <- c("Index", "Series", "Value")
  if(!is.null(names(names))) names <- names[nm]
  if(is.list(names)) {
    names(names) <- nm
    for(i in 1L:3L) if(is.null(names[[i]]) || anyNA(names[[i]])) names[[i]] <- nm[i]
    nm <- unlist(names)
  } else {
    names <- rep_len(names, 3L)
    nm[!is.na(names)] <- names[!is.na(names)]
  }
  
  ## either long format (melt = TRUE) or wide format (melt = FALSE)
  if(melt) {
    df <- if(k == 1L) {    
      do.call("data.frame", c(
        list(index(model), factor(rep.int(1, n), labels = lab), coredata(model)),
	dots))
    } else {
      do.call("data.frame", c(
        list(index(model)[rep.int(1:n, k)],
          factor(rep(1:k, each = n), levels = 1:k, labels = lab),
	  as.vector(coredata(model))),
	dots))
    }
    if (!is.null(sep)) {
      df <- data.frame(df[1L], 
        do.call("rbind", strsplit(as.character(df[[2L]]), ".", fixed = TRUE)),
	df[3L])
    }
    nl <- length(nm)
    names(df) <- c(nm[1L], make.unique(rep_len(nm[-c(1L, nl)], ncol(df) - 2L)), nm[nl])
  } else {
    df <- cbind(
      do.call("data.frame", c(list(index(model)), dots)), 
      coredata(model))
    names(df) <- c(nm[1L], lab)  
  }
  
  return(df)
}
R/ggplot2.zoo.R:1

autoplot.zoo untypeabletyped

unbound variable (line 66)
unbound: substitute — a name the prelude does not declare
error detail
name: substitute
gradual mode: typed
((object: any, geom: CHR1?, facets: any, ...: any) -> any)<>
timing: 0.164 s
source
autoplot.zoo <- function(object, geom = "line", facets, ...)
{
  ## convert to data.frame (and assure correct label
  ## processing by fortify.zoo)
  lab <- deparse(substitute(object))
  if(NCOL(object) == 1L) {
    if(is.null(dim(object))) dim(object) <- c(NROW(object), 1L)
    if(is.null(colnames(object))) colnames(object) <- lab
  }
  if(is.null(colnames(object))) colnames(object) <- paste(lab, 1:NCOL(object), sep = ".")
  df <- fortify.zoo(object, melt = TRUE)

  ## default for facets
  single <- nlevels(df$Series) == 1L
  if(missing(facets)) {
    auto <- TRUE
    facets <- if(single) NULL else Series ~ .
  } else {
    auto <- FALSE
  }

  ## process defaults as for old qplot-based interface
  if(is.character(geom)) geom <- get(paste0("geom_", geom), asNamespace("ggplot2"))
  if(inherits(facets, "formula")) facets <- ggplot2::facet_grid(facets)
  
  ## "fake" variables for nonstandard evaluation
  Index <- Value <- Series <- NULL

  ## call qplot
  gg <- if(single | (!is.null(facets) & auto)) {
    ggplot2::ggplot(df, ggplot2::aes(x = Index, y = Value, ...)) + geom() + facets + ggplot2::ylab(if(single) levels(df$Series) else "") + ggplot2::xlab("Index")
  } else {
    ggplot2::ggplot(df, ggplot2::aes(x = Index, y = Value, group = Series, colour = Series, ...)) + geom() + facets + ggplot2::ylab("") + ggplot2::xlab("Index")    
  }
  return(gg)
}
R/ggplot2.zoo.R:62

facet_free untypeabletyped

unbound variable (line 99)
unbound: Series — a name the prelude does not declare
error detail
name: Series
gradual mode: typed
((facets: any?, margins: any?, scales: any?, ...: any) -> any)<>
timing: 0.018 s
source
facet_free <- function (facets = Series ~ ., margins = FALSE, scales = "free_y", ...) {
  ggplot2::facet_grid(facets, margins = margins, scales = scales, ...)
}
R/ggplot2.zoo.R:99

yearmon_trans untypeabletyped

unbound variable (line 104)
unbound: scales::pretty_breaks — a name the prelude does not declare
error detail
name: scales::pretty_breaks
gradual mode: typed
((format: any?, n: any?) -> any)<>
timing: 0.021 s
source
yearmon_trans <- function(format = "%b %Y", n = 5) {
  breaks. <- function(x) as.yearmon(scales::pretty_breaks(n)(x))
  format. <- function(x) format(x, format = format)
  scales::trans_new("yearmon", transform = as.numeric, inverse = as.yearmon,
    breaks = breaks., format = format.)
}
R/ggplot2.zoo.R:103

scale_x_yearmon skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
scale_x_yearmon <- function(..., format = "%b %Y", n = 5) {
  ggplot2::scale_x_continuous(..., transform = yearmon_trans(format, n))
}
R/ggplot2.zoo.R:110

scale_y_yearmon skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
scale_y_yearmon <- function(..., format = "%b %Y", n = 5) {
  ggplot2::scale_y_continuous(..., transform = yearmon_trans(format, n))
}
R/ggplot2.zoo.R:113

yearqtr_trans untypeabletyped

unbound variable (line 118)
unbound: scales::pretty_breaks — a name the prelude does not declare
error detail
name: scales::pretty_breaks
gradual mode: typed
((format: any?, n: any?) -> any)<>
timing: 0.020 s
source
yearqtr_trans <- function(format = "%Y-%q", n = 5) {
  breaks. <- function(x) as.yearqtr(scales::pretty_breaks(n)(x))
  format. <- function(x) zoo::format.yearqtr(x, format = format)
  scales::trans_new("yearqtr", transform = as.numeric, inverse = as.yearqtr,
    breaks = breaks., format = format.)
}
R/ggplot2.zoo.R:117

scale_x_yearqtr skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
scale_x_yearqtr <- function(..., format = "%Y-%q", n = 5) {
  ggplot2::scale_x_continuous(..., transform = yearqtr_trans(format, n))
}
R/ggplot2.zoo.R:124

scale_y_yearqtr skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
scale_y_yearqtr <- function(..., format = "%Y-%q", n = 5) {
  ggplot2::scale_y_continuous(..., transform = yearqtr_trans(format, n))
}
R/ggplot2.zoo.R:127

scale_type.yearqtr typed any: x accepts outside

((x: any) -> CHR<>)<>
timing: 0.028 s
fuzzing: 7 inside (7 ok) · 8 outside (7 rejected, 1 accepted)

Accepted outside the domain x: 1

parameterchangecallreturned
xdropscale_type.yearqtr()(CHR & ~vec1)<> with { }
source
scale_type.yearqtr <- function(x) c("yearqtr", "continuous")
R/ggplot2.zoo.R:131

scale_type.yearmon typed any: x accepts outside

((x: any) -> CHR<>)<>
timing: 0.028 s
fuzzing: 7 inside (7 ok) · 8 outside (7 rejected, 1 accepted)

Accepted outside the domain x: 1

parameterchangecallreturned
xdropscale_type.yearmon()(CHR & ~vec1)<> with { }
source
scale_type.yearmon <- function(x) c("yearmon", "continuous")
R/ggplot2.zoo.R:133
R/merge.zoo.R

rbind.zoo untypeable

unbound variable (line 4)
unbound: Negate — a name the prelude does not declare
error detail
name: Negate
timing: 4.19 s
source
rbind.zoo <- function(..., deparse.level = 1)
{  

  args <- Filter(Negate(is.null), list(...))
  indexes <- do.call("c", unname(lapply(args, index)))

  my.table <- function(x) {
    ix <- ORDER(x)
    x <- x[ix]
    table(MATCH(x,x))
  }
  if(max(my.table(indexes)) > 1L) stop("indexes overlap")

  if(any(sapply(args, function(x) is.null(dim(x)) && length(x) == 0L && length(index(x)) > 0L)))
    stop("zero-length vectors with non-zero-length index are not allowed")  

  ncols <- sapply(args, NCOL)
  if(!all(ncols == ncols[1L])) stop("number of columns differ")
  
  ## process colnames() if any
  nams <- lapply(args, colnames)
  namsNULL <- sapply(nams, is.null)
  if(all(namsNULL)) namsOK <- TRUE else {
    if(sum(namsNULL) > 0L) namsOK <- FALSE else {
      nam1 <- nams[[1L]]
      namsID <- sapply(nams, function(x) identical(x, nam1))
      if(all(namsID)) namsOK <- TRUE else {
        namsSORT <- sapply(nams, function(x) identical(sort(x), sort(nam1)))
	if(!all(namsSORT)) namsOK <- FALSE else {
	  namsOK <- TRUE
	  for(i in which(!namsID)) args[[i]] <- args[[i]][,nam1]
	}
      }
    }
  }
  if(!namsOK) warning("column names differ")

  ## collect data
  argsdata <- lapply(args, coredata)

  ## (special case: rbinding of vectors with one-column matrices)
  nulldim <- sapply(argsdata, function(a) is.null(dim(a)))
  if(ncols[1L] == 1L) {
    if(nulldim[1] & any(!nulldim)) {
      argsdata <- lapply(argsdata, function(a) if(is.null(dim(a))) a else a[,1, drop = TRUE])
      nulldim <- rep(TRUE, length(nulldim))
    }
    if(!nulldim[1] & any(nulldim)) {
      argsdata <- lapply(argsdata, function(a) if(is.null(dim(a))) as.matrix(a) else a)
      nulldim <- rep(FALSE, length(nulldim))
    }
  }

  if((ncols[1L] > 1L) | !all(nulldim))
    rval <- zoo(do.call("rbind", argsdata), indexes)
  else
    rval <- zoo(do.call("c", argsdata), indexes)

  freq <- if(!("zooreg" %in% unlist(sapply(args, class)))) NULL
            else {
	      freq <- c(frequency(rval), unlist(sapply(args, frequency)))
	      if((length(freq) == (length(args)+1L)) && 
	         identical(all.equal(max(freq)/freq, round(max(freq)/freq)), TRUE))
		 max(freq) else NULL
	    }
  if(!is.null(freq)) {
    attr(rval, "frequency") <- freq
    class(rval) <- c("zooreg", class(rval))
  }
  return(rval)
}
R/merge.zoo.R:1

c.zoo untypeabletyped

unbound variable (line 74)
unbound: rbind.zoo — one of the package’s own names, itself untyped
error detail
name: rbind.zoo
gradual mode: typed
((...: any) -> any)<>
timing: 0.002 s
source
c.zoo <- function(...) {
    rbind.zoo(...)
}
R/merge.zoo.R:73

merge.zoo skipped

error detail
Invalid_argument("Variable ..._5 is already bound.")
timing: 0.682 s
source
merge.zoo <- function(..., all = TRUE, fill = NA, suffixes = NULL, check.names = FALSE, retclass = c("zoo", "list", "data.frame"), drop = TRUE, sep = ".")
{
    if (!is.null(retclass)) retclass <- match.arg(retclass)
    # cl are calls to the args and args is a list of the arguments
    cl <- as.list(match.call())
    cl[[1]] <- cl$all <- cl$fill <- cl$retclass <- cl$suffixes <- cl$check.names <- cl$drop <- cl$sep <- NULL
    args <- list(...)

    parent <- parent.frame()

    is.plain <- function(x) 
	all(class(x) %in% c("array", "integer", "numeric", "factor", "matrix", "logical", "character"))

    is.scalar <- function(x) is.plain(x) && length(x) == 1

    # ensure all ... plain args are of length 1 or have same NROW as arg 1
    stopifnot(all(sapply(args, function(x) is.zoo(x) || !is.plain(x) ||
      (is.plain(x) && (NROW(x) == NROW(args[[1]]) || is.scalar(x))))))

    scalars <- sapply(args, is.scalar)

    if(!is.zoo(args[[1]])) args[[1]] <- as.zoo(args[[1]])
    for(i in seq_along(args))
        if (is.plain(args[[i]]))  
            args[[i]] <- zoo(args[[i]], index(args[[1]]), attr(args[[1]], "frequency"))
	else if (!is.zoo(args[[i]]))
            args[[i]] <- as.zoo(args[[i]])

    ## retain frequency	if all series have integer multiples of the same frequency
    ## and at least one of the original objects is a "zooreg" object	
    freq <- if(!("zooreg" %in% unlist(sapply(args, class)))) NULL
        else {
	  freq <- unlist(sapply(args, frequency))
	  if((length(freq) == length(args)) && 
	     identical(all.equal(max(freq)/freq, round(max(freq)/freq)), TRUE))
	     max(freq) else NULL
	}

    # use argument names if suffixes not specified
    if (is.null(suffixes)) {
        makeNames <- function(l) {
            nm <- names(l)
            fixup <- if (is.null(nm)) 
                seq_along(l)
            else nm == ""
            dep <- sapply(l[fixup], function(x) deparse(x)[1])
            if (is.null(nm)) 
                return(dep)
            if (any(fixup)) 
                nm[fixup] <- dep
            nm
        }
        suffixes <- makeNames(as.list(substitute(list(...)))[-1])
    }
    if (length(suffixes) != length(cl)) {
        warning("length of suffixes and does not match number of merged objects")
        suffixes <- rep(suffixes, length.out = length(cl))
    }

    # extend all to a length equal to the number of args
    all <- rep(as.logical(all), length.out = length(cl))

    ## check indexes:
    indexlist <- lapply(args, index)
    ## 1. for non-unique entries
    index_duplicates <- function(x) length(unique(MATCH(x, x))) < length(x)
    if(any(sapply(indexlist, index_duplicates)))
      stop("series cannot be merged with non-unique index entries in a series")
    ## 2. for differing classes
    indexclasses <- sapply(indexlist, function(x) class(x)[1])
    if (!all(indexclasses == indexclasses[1L])) {
        warning(paste("Index vectors are of different classes:", 
            paste(indexclasses, collapse = " ")))
	if(all(indexclasses %in% c("numeric", "integer"))) {
	    indexlist <- lapply(indexlist, as.numeric)
	} else if(all(vapply(indexlist, function(e) inherits(e, "Date") || is.numeric(e), NA))) {
            indexlist <- lapply(indexlist, as.Date)
	}
    }

    # fn to get the unique elements in x, in sorted order, using only
    # [, match, length and order
    sort.unique <- function(x) {
        ix <- MATCH(x, x) == seq_len(length(x))
	x <- x[ix]
        ix <- ORDER(x)
        x[ix]
    }

    # fn to get intersection of each element in list of lists
    intersect.list <- function(list) { 
        my.table <- function(x) {
	   ix <- ORDER(x)
           x <- x[ix]
           table(MATCH(x, x))
	}
	union <- do.call("c", unname(list))
	sort.unique(union)[which(my.table(union) == length(list))]
    }
    indexintersect <- intersect.list(indexlist)

    # get the indexes of the final answer which is the union of
    # all indexes of args corresponding to all=TRUE with the intersection
    # of all indexes
    indexunion <- do.call("c", unname(indexlist[all]))
    
    indexes <-  if(is.null(indexunion)) indexintersect
      else sort.unique(c(indexunion, indexintersect))
    # previously, we used to do:
    # if (is.null(indexunion)) indexunion <- do.call("c", indexlist)[0]
    # indexes <- sort.unique(c(indexunion, indexintersect))

    ## check whether resulting objects still got the same frequency
    if(!is.null(freq)) {
      freq <- c(frequency(zoo(,indexes)), freq)
      freq <- if((length(freq) == 2) && identical(all.equal(max(freq)/freq, round(max(freq)/freq)), TRUE))
        max(freq) else NULL
    }

    # the f function does the real work
    # it takes a zoo object, a, and fills in a matrix corresponding to
    # indexes with the values in a. ret.zoo is TRUE if it is to return
    # a zoo object.  If ret.zoo is FALSE it simply returns with the matrix
    # just calculated.  
    # match0 is convenience wrapper for MATCH with nomatch=0 default
    match0 <- function(a, b, nomatch = 0, ...) MATCH(a, b, nomatch = nomatch, ...)
    f <- if (any(all)) {
       function(a, ret.zoo = TRUE) {
        if (length(a) == 0 && length(dim(a)) == 0)
	   return(if(ret.zoo) {
	            rval <- zoo(, indexes)
	            attr(rval, "frequency") <- freq
	            if(!is.null(freq)) class(rval) <- c("zooreg", class(rval))
		    rval
		  } else numeric())
        z <- matrix(fill, length(indexes), NCOL(a))
	if (length(dim(a)) > 0)
           z[match0(index(a), indexes), ] <- a[match0(indexes, index(a)), , drop = FALSE]        
        else {
           z[match0(index(a), indexes), ] <- a[match0(indexes, index(a))]
           z <- z[, 1, drop=TRUE]
        }
 	if (ret.zoo) {
	  z <- zoo(z, indexes)
	  attr(z, "oclass") <- attr(a, "oclass")
	  attr(z, "levels") <- attr(a, "levels")
	  attr(z, "frequency") <- freq
	  if(!is.null(freq)) class(z) <- c("zooreg", class(z))
	}
	return(z)
      }
    
    } else {
    # if all contains only FALSE elements then the following f is used
    # instead of the prior f for performance purposes.  If all contains
    # only FALSE then the resulting index is the intersection of the
    # index of each argument so we can just return a[index] or a[index,].
    # Also if we are not to return a zoo object then unclass it prior to return.
      function(a, ret.zoo = TRUE) {
	if (!ret.zoo) class(a) <- NULL
	if (length(dim(a)) == 0) {
		if (length(a) == 0) {
		   rval <- if(ret.zoo) zoo(, indexes) else numeric()
		} else
		   rval <- as.zoo(a[match0(indexes, attr(a, "index"))])
	} else
		rval <- as.zoo(a[match0(indexes, attr(a, "index")), , drop=FALSE])
        if(is.zoo(rval) && !is.null(freq)) {
	  attr(rval, "frequency") <- freq
	  class(rval) <- unique(c("zooreg", class(rval)))
	}
	return(rval)
      }
    }

    # if retclass is NULL do not provide a return value but instead
    # update each argument that is a variable, i.e. not an expression,
    # in place.  
    if (is.null(retclass)) {
        for(vn in cl) {
           if (is.name(vn))
           tryCatch(
	     eval(substitute(v <- f(v), list(f = f, v = vn)), parent), 
	     condition = function(x) {}
           )
        }
	invisible(return(NULL))
    } 

    # apply f to each arg, put result of doing this on all args in list rval
    # and then cbind that list together to produce the required matrix
    rval <- lapply(args, f, ret.zoo = retclass %in% c("list", "data.frame"))
    ## have commented this next line out.  Is it needed?
    # for(i in which(scalars)) rval[[i]] <- rval[[i]][] <- zoo(coredata(rval[[i]])[1], index(rval[[1]]), freq)
    names(rval) <- suffixes
    if (retclass == "list") { 
	return(rval)
    }
    if (retclass == "data.frame") {
R/merge.zoo.R:83

cbind.zoo skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
cbind.zoo <- function(..., all = TRUE, fill = NA, suffixes = NULL, drop = FALSE, sep = ".")
{
  merge.zoo(..., all = all, fill = fill, suffixes = suffixes, retclass = "zoo", drop = drop, sep = sep)
}
R/merge.zoo.R:77
R/na.trim.R

na.trim untypeabletyped

unbound variable (line 1)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((object: any, ...: any) -> any)<>
timing: 0.003 s
source
na.trim <- function(object, ...) UseMethod("na.trim")
R/na.trim.R:1

na.trim.default untypeabletyped

unbound variable (line 7)
unbound: complete.cases — a name the prelude does not declare
error detail
name: complete.cases
gradual mode: typed
((object: any, sides: (vec | null)?, is.na: (vec | null)?, maxgap: any?, ...: any) -> any)<>
timing: 0.386 s
source
na.trim.default <- function (object, sides = c("both", "left", "right"), 
	is.na = c("any", "all"), maxgap = Inf, ...)
{
   is.na <- match.arg(is.na, c("any", "all"))
   nisna <- if (is.na == "any" || length(dim(object)) < 2L)  {
	complete.cases(object)
   } else rowSums(!is.na(object)) > 0
   rlength <- function(x) if(all(!x)) length(x) else min(which(x)) - 1L
   idx <- switch(match.arg(sides),
       left = {
           idx0 <- cumsum(nisna) > 0
	   idx0 | rlength(idx0) > maxgap
       },
       right = {
           idx0 <- cumsum(rev(nisna) > 0) > 0
	   rev(idx0) | rlength(idx0) > maxgap
       },
       both = {
           idx0l <- cumsum(nisna) > 0
	   idx0r <- cumsum(rev(nisna) > 0) > 0
	   (idx0l | rlength(idx0l) > maxgap) & (rev(idx0r) | rlength(idx0r) > maxgap)
       }
   )
   if (length(dim(object)) < 2L)
       object[idx]
   else
       object[idx,, drop = FALSE]
}
R/na.trim.R:2

na.trim.ts untypeabletyped

unbound variable (line 34)
unbound: as.zoo — one of the package’s own names, itself untyped
error detail
name: as.zoo
gradual mode: typed
((object: any, ...: any) -> any)<>
timing: 0.004 s
source
na.trim.ts <- function (object, ...)
{
    as.ts(na.trim(as.zoo(object), ...))
}
R/na.trim.R:32
R/na.approx.R

na.approx untypeabletyped

unbound variable (line 1)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((object: any, ...: any) -> any)<>
timing: 0.003 s
source
na.approx <- function(object, ...) UseMethod("na.approx")
R/na.approx.R:1

.fill_short_gaps untypeabletyped

unbound variable (line 126)
unbound: rle — a name the prelude does not declare
error detail
name: rle
gradual mode: typed
((x: any, fill: any, maxgap: vec) -> any)<>
timing: 0.225 s
source
.fill_short_gaps <- function(x, fill, maxgap) {
    if (maxgap <= 0)
        return(x)
    if (maxgap >= length(x))
        return(fill)
    naruns <- rle(is.na(x))
    naruns$values[naruns$lengths > maxgap] <- FALSE
    naok <- inverse.rle(naruns)
    x[naok] <- fill[naok]
    return(x)
}
R/na.approx.R:121

na.approx.default skipped

error detail
Invalid_argument("Variable ..._5 is already bound.")
timing: 0.100 s
source
na.approx.default <- function(object, x = index(object), xout = x, ..., na.rm = TRUE, maxgap = Inf, along) {

    if (!missing(along)) {
        warning("along to be deprecated - use x instead")
        if (missing(x)) x <- along
    }

    na.approx.vec <- function(x, y, xout = x, ...) {
        na <- is.na(y)
	if(sum(!na) < 2L) {
	    ## approx() cannot be applied here, hence simply:
	    yf <- rep.int(NA, length(xout))
	    mode(yf) <- mode(y)
	    if(any(!na)) {
	        if(x[!na] %in% xout) {
		    yf[xout == x[!na]] <- y[!na]
		}
	    }
	    return(yf)
	}
	if(all(!na) && (length(xout) > maxgap) && !all(xout %in% x)) {
	    ## for maxgap to work correctly 'y' has to contain
	    ## actual NAs and be expanded to the full x-index
	    xf <- sort(unique(c(x, xout)))
	    yf <- rep.int(NA, length(xf))
	    yf[MATCH(x, xf)] <- y
	    x <- xf
	    y <- yf
	}
        yf <- approx(x[!na], y[!na], xout, ...)$y
        if (maxgap < length(y)) {
            ## construct a series like y but with only gaps > maxgap
            ## (actual values don't matter as we only use is.na(ygap) below)
            ygap <- .fill_short_gaps(y, seq_along(y), maxgap = maxgap)
            ## construct y values at 'xout', keeping NAs from ygap
            ## (using indexing, as approx() does not allow NAs to be propagated)
            ix <- approx(x, seq_along(y), xout, ...)$y
            yx <- ifelse(is.na(ygap[floor(ix)] + ygap[ceiling(ix)]), NA, yf)
            yx
        } else {
            yf
        }
    }

    if (!identical(length(x), length(index(object)))) {
        stop("x and index must have the same length")
    }
    x. <- as.numeric(x)
    if (missing(xout) || is.null(xout)) xout <- x.
    xout. <- as.numeric(xout)
    object. <- coredata(object)

    result <- if (length(dim(object.)) < 2) {
        na.approx.vec(x., coredata(object.), xout = xout., ...)
    } else {
        apply(coredata(object.), 2, na.approx.vec, x = x., xout = xout., ...)
    }

    if (na.rm) {
        result <- na.trim(result, is.na = "all", maxgap = maxgap)
    }

    result

}
R/na.approx.R:49

na.approx.zoo skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.009 s
source
na.approx.zoo <- function(object, x = index(object), xout, ..., na.rm = TRUE, maxgap = Inf, along) {

    if (!missing(along)) {
        warning("along to be deprecated - use x instead")
        if (missing(x)) x <- along
    }

    missing.xout <- missing(xout) || is.null(xout)
    if (is.function(x)) x <- x(index(object))
    if (!missing.xout && is.function(xout)) xout <- xout(index(object))
    order.by <- if (missing.xout) index(object) else xout
    xout <- if (missing.xout) x else xout

    if (missing.xout || identical(xout, index(object))) {
        result <- object
    } else {
        object.x <- object
        if (!identical(class(x), class(xout))) {
            index(object.x) <- as.numeric(x)
            xout <- as.numeric(xout)
        } else {
            index(object.x) <- x
        }
        objectm <- merge(object.x, zoo(, xout))
        if (length(dim(objectm)) == 2) colnames(objectm) <- colnames(object)
        result <- window(objectm, index. = xout)
    }
    result[] <- na.approx.default(object, x = x, xout = xout, na.rm = FALSE, ..., maxgap = maxgap)
    if ((!missing(order.by) && !is.null(order.by)) || !missing.xout) {
        index(result) <- order.by
    }

    if (na.rm) {
        result <- na.trim(result, is.na = "all", maxgap = maxgap)
    }

    result

}
R/na.approx.R:3

na.approx.zooreg untypeabletyped

unbound variable (line 45)
unbound: na.approx — one of the package’s own names, itself untyped
error detail
name: na.approx
gradual mode: typed
((object: any, ...: any) -> any)<>
timing: 0.064 s
source
na.approx.zooreg <- function(object, ...) {
    object. <- structure(object, class = setdiff(class(object), "zooreg"))
    as.zooreg(na.approx(object., ...))
}
R/na.approx.R:43

na.approx.ts untypeabletyped

unbound variable (line 116)
unbound: as.zoo — one of the package’s own names, itself untyped
error detail
name: as.zoo
gradual mode: typed
((object: any, ...: any) -> any)<>
timing: 0.004 s
source
na.approx.ts <- function(object, ...) {
    as.ts(na.approx(as.zoo(object), ...))
}
R/na.approx.R:115
R/na.StructTS.R

na.StructTS untypeabletyped

unbound variable (line 2)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((object: any, ...: any) -> any)<>
timing: 0.003 s
source
na.StructTS <- function(object, ...) UseMethod("na.StructTS")
R/na.StructTS.R:2

na.StructTS.ts untypeabletyped

unbound variable (line 9)
unbound: StructTS — a name the prelude does not declare
error detail
name: StructTS
gradual mode: typed
((object: any, ...: any, na.rm: any?, maxgap: any?) -> any)<>
timing: 0.048 s
source
na.StructTS.ts <- function(object, ..., na.rm = FALSE, maxgap = Inf)
{
    na.StructTS.0 <- function(y) {
        yf <- y
		isna <- is.na(y)
		yf[isna] <- rowSums(tsSmooth(StructTS(y))[,-2])[isna]
        .fill_short_gaps(y, yf, maxgap = maxgap)
    }
    object[] <- if (length(dim(object)) == 0) na.StructTS.0(object)
                else apply(object, 2, na.StructTS.0)
    if (na.rm) na.trim(object, is.na = "all") else object
}
R/na.StructTS.R:4

na.StructTS.zoo skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
na.StructTS.zoo <- function(object, ..., na.rm = FALSE, maxgap = Inf) {
	z <- na.StructTS(as.ts(object), ..., na.rm = FALSE, maxgap = maxgap)
	z <- as.zoo(z)
	time(z) <- time(object)
    if (na.rm) na.trim(z, is.na = "all") else z
}
R/na.StructTS.R:17
R/na.aggregate.R

na.aggregate untypeabletyped

unbound variable (line 1)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((object: any, ...: any) -> any)<>
timing: 0.004 s
source
na.aggregate <- function(object, ...) UseMethod("na.aggregate")
R/na.aggregate.R:1

na.aggregate.default untypeable

unbound variable (line 5)
unbound: mean — a name the prelude does not declare
error detail
name: mean
timing: 0.052 s
source
na.aggregate.default <- function(object, by = 1, ..., FUN = mean, na.rm = FALSE, maxgap = Inf)
{
    if (is.function(by)) by <- by(time(object), ...)
    ## applied to each aggregated group in each series:
    f <- function(x)
        replace(x, is.na(x), FUN(x[!is.na(x)]))
    na.aggregate.0 <- function(y) {
        yf <- ave(y, by, FUN = f)
        .fill_short_gaps(y, yf, maxgap = maxgap)
    }
    object[] <- if (length(dim(object)) == 0) na.aggregate.0(object)
                else apply(object, 2, na.aggregate.0)
    if (na.rm) na.trim(object, is.na = "all") else object
}
R/na.aggregate.R:5
R/na.fill.R

na.fill0 untypeable

unbound variable (line 13)
unbound: lengths — a name the prelude does not declare
error detail
name: lengths
timing: 3.77 s
source
na.fill0 <- function(object, fill, ix = !is.na(object))
{
  if (length(object) == 0L) {
    object
  } else if (length(fill) == 0L || sum(lengths(as.list(fill))) == 0L) {
    structure(object[ix], na.action = which(!ix))
  } else if (length(fill) == 1L) {
    if (identical(as.list(fill)[[1L]], "extend"))
      stop("fill cannot be 'extend'")
    if (!is.logical(ix)) ix <- seq_along(object) %in% ix
    replace(object, !ix, as.list(fill)[[1L]])
  } else {
    fill <- rep(as.list(fill), length.out = 3L)
    if (identical(fill[[2L]], "extend")) 
      stop("fill[[2L]] cannot be 'extend'")
    ix <- if (is.logical(ix)) rep(ix, length.out = length(object)) else seq_along(object) %in% ix
    wx <- which(ix)
    if (length(wx) == 0L) {
      object[] <- fill[[2L]]
      object
    } else {
      rng <- range(wx)

      if (identical(fill[[1L]], "extend")) fill[[1L]] <- object[rng[1L]]
      if (identical(fill[[3L]], "extend")) fill[[3L]] <- object[rng[2L]]

      fill_lens <- lengths(fill)

      pre <- seq_along(ix) < rng[1L]
      post <- seq_along(ix) > rng[2L]

      if (fill_lens[2L]) object[!ix] <- fill[[2L]]
      if (fill_lens[1L]) object[pre] <- fill[[1L]]
      if (fill_lens[3L]) object[post] <- fill[[3L]]

      omit <- (pre & !fill_lens[1L]) |
              (!pre & !post & !ix & !fill_lens[2L]) |
              (post & !fill_lens[3L])
      object <- object[!omit]
      if (sum(omit)) structure(object, na.action = which(omit)) else object
    }
  }
}
R/na.fill.R:9

na.fill untypeabletyped

unbound variable (line 53)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((object: any, fill: any, ...: any) -> any)<>
timing: 0.006 s
source
na.fill <- function(object, fill, ...) UseMethod("na.fill")
R/na.fill.R:53

na.fill.zoo timeout

timing: 20.00 s
source
na.fill.zoo <- function(object, fill, ix, ...) {

	if (length(dim(object)) == 2 && NCOL(object) > 1) {
		ixmiss <- missing(ix)
		L <- lapply(1:NCOL(object), 
				function(i) {
					if (ixmiss) ix <- !is.na(object[,i])
					na.fill(object[,i], fill, ix, ...)
				})
		out <- do.call("merge", c(L, all = FALSE))
		colnames(out) <- colnames(object)
		return(out)
	}

	if (missing(ix)) ix <- !is.na(object)

	if ((is.logical(ix) && any(ix)) || (!is.logical(ix) && length(ix))) {

		n <- length(object)
		# integer indexes for output points which are present
		wix <- if (is.logical(ix)) which(ix) else ix
		# min and max integer index
		wx.min <- head(wix, 1) 
		wx.max <- tail(wix, 1)
		# similar to wrng <- wx.min:wx.max
		wrng <- seq(wx.min, length.out = wx.max - wx.min + 1)

		# recycle to length 3
		fill <- rep(as.list(fill), length.out = 3)
		# we will be coercing fill values to the class of coredata(data).
		# This allows fill=c("extend", NA) to work even though NA is coerced to
		#  a character NA.
		as.cls <- if (is.integer(coredata(object))) {
		  as.integer
		} else if(is.numeric(coredata(object))) {
		  as.numeric
		} else if(is.character(coredata(object))) {
		  as.character
                } else {
		  as.logical
		}
		fill <- lapply(fill, function(x) if (is.character(x) &&
			pmatch(x, "extend", nomatch = 0)) "extend" else as.cls(x))
		# fill points on left
		if (length(fill[[1]]) > 0) 
			if (!is.null(fill[[1]])) object[seq_len(wx.min - 1)] <- 
				if (is.character(fill[[1]]) && !is.na(fill[[1]]) && fill[[1]] == "extend")
						object[[wx.min]] else fill[[1]]
		# fill intermediate points
		# - this is for zoo method, for zooreg method it would be possible to
		#   perform linear interpolation in proportion to time rather than
		#   in proportion to the integer index
		if (length(fill[[2]]) > 0) {
			if (is.character(fill[[2]]) && !is.na(fill[[2]]) && fill[[2]] == "extend") object[wrng] <- 
					# as.list(approx(wix, unlist(object[wix]), xout = wrng)$y)
					approx(wix, unlist(object[wix]), xout = wrng)$y
			else object[intersect(which(!ix), wrng)] <- fill[[2]]
		}
		# fill points on right
		if (length(fill[[3]]) > 0) 
			object[seq(wx.max + 1, length.out = n - wx.max)] <- 
				if (is.character(fill[[3]]) && !is.na(fill[[3]]) && fill[[3]] == "extend")
						object[[wx.max]] else fill[[3]]

		keep <- seq_len(n)
		if (length(fill[[1]]) == 0) keep <- unique(pmax(wx.min, keep))
		if (length(fill[[2]]) == 0) {
			wrng <- seq(wx.min, length.out = wx.max - wx.min + 1)
			keep <- setdiff(keep, intersect(which(!ix), wrng))
		}
		if (length(fill[[3]]) == 0) keep <- unique(pmin(wx.max, keep)) 
		return(object[keep, , drop = is.null(dim(object))])
	} else if(length(fill)) {
	  fill <- unlist(fill[1])[1]
	  object[is.na(object)] <- if(!is.na(fill) && fill == "extend") NA else fill
	  return(object)
	}
}
R/na.fill.R:55

na.fill.default untypeabletyped

unbound variable (line 135)
unbound: zoo — one of the package’s own names, itself untyped
error detail
name: zoo
gradual mode: typed
((object: any, fill: any, ix: any, ...: any) -> any)<>
timing: 0.011 s
source
na.fill.default <- function(object, fill, ix, ...) {
	coredata(na.fill(zoo(object), fill, ix, ...))
}
R/na.fill.R:134

na.fill.ts untypeabletyped

unbound variable (line 139)
unbound: as.zoo — one of the package’s own names, itself untyped
error detail
name: as.zoo
gradual mode: typed
((object: any, fill: any, ix: any, ...: any) -> any)<>
timing: 0.011 s
source
na.fill.ts <- function(object, fill, ix, ...) {
	as.ts(na.fill(as.zoo(object), fill, ix, ...))
}
R/na.fill.R:138
R/na.locf.R

na.locf0 untypeable

untypeable assignment (line 2)
error detail
variable: coredata
expected: null
given: ff<> | tt<>
expression may be: TRUE
timing: 0.362 s
source
na.locf0 <- function(object, fromLast = FALSE, maxgap = Inf, coredata = NULL) {
  if(is.null(coredata)) coredata <- inherits(object, "ts") || inherits(object, "zoo") || inherits(object, "its") || inherits(object, "irts")
  if(coredata) {
    x <- object
    object <- if (fromLast) rev(coredata(object)) else coredata(object)
  } else {
    if(fromLast) object <- rev(object)
  }
  ok <- which(!is.na(object))
  if(is.na(object[1L])) ok <- c(1L, ok)
  gaps <- diff(c(ok, length(object) + 1L))
  object <- if(any(gaps > maxgap)) {
    .fill_short_gaps(object, rep(object[ok], gaps), maxgap = maxgap)
  } else {
    rep(object[ok], gaps)
  }
  if (fromLast) object <- rev(object)
  if(coredata) {
    x[] <- object
    return(x)
  } else {
    return(object)
  }
}
R/na.locf.R:1

na.locf untypeabletyped

unbound variable (line 27)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((object: any, na.rm: any?, ...: any) -> any)<>
timing: 0.008 s
source
na.locf <- function(object, na.rm = TRUE, ...)
	UseMethod("na.locf")
R/na.locf.R:26

na.locf.default untypeabletyped

unbound variable (line 37)
unbound: na.approx — one of the package’s own names, itself untyped
error detail
name: na.approx
gradual mode: typed
((object: any, na.rm: any?, fromLast: any, rev: any, maxgap: any?, rule: any?, ...: any) -> any)<>
timing: 0.346 s
source
na.locf.default <- function(object, na.rm = TRUE, fromLast, rev, maxgap = Inf, rule = 2, ...) {

	L <- list(...)
	if ("x" %in% names(L) || "xout" %in% names(L)) {

		if (!missing(fromLast)) {
			stop("fromLast not supported if x or xout is specified")
		}
		return(na.approx(object, na.rm = na.rm, 
			maxgap = maxgap, method = "constant", rule = rule, ...))
	}

   	if (!missing(rev)) {
	   warning("na.locf.default: rev= deprecated. Use fromLast= instead.")
	   if (missing(fromLast)) fromLast <- rev
	} else if (missing(fromLast)) fromLast <- FALSE
	rev <- base::rev
	object[] <- if (length(dim(object)) == 0)
		na.locf0(object, fromLast = fromLast, maxgap = maxgap)
	else
		apply(object, length(dim(object)), na.locf0, fromLast = fromLast, maxgap = maxgap)
	if (na.rm) na.trim(object, is.na = "all") else object
}
R/na.locf.R:29

na.locf.data.frame untypeabletyped

unbound variable (line 55)
unbound: na.locf0 — one of the package’s own names, itself untyped
error detail
name: na.locf0
gradual mode: typed
((object: any, na.rm: any?, fromLast: any?, maxgap: any?, ...: any) -> any)<>
timing: 0.029 s
source
na.locf.data.frame <- function(object, na.rm = TRUE, fromLast = FALSE, maxgap = Inf, ...)
{
    object[] <- lapply(object, na.locf0, fromLast = fromLast, maxgap = maxgap)
    if (na.rm) na.omit(object) else object
}
R/na.locf.R:53

na.contiguous.data.frame untypeable

unbound variable (line 64)
unbound: apply — a name the prelude does not declare
error detail
name: apply
timing: 2.81 s
source
na.contiguous.data.frame <-
na.contiguous.zoo <- function(object, ...) 
{
    if (length(dim(object)) == 2) 
        good <- apply(!is.na(object), 1, all)
    else good <- !is.na(object)
    if (!sum(good)) 
        stop("all times contain an NA")
    tt <- cumsum(!good)
    ln <- sapply(0:max(tt), function(i) sum(tt == i))
    seg <- (seq_along(ln)[ln == max(ln)])[1] - 1
    keep <- (tt == seg)
    st <- min(which(keep))
    if (!good[st]) 
        st <- st + 1
    en <- max(which(keep))
    omit <- integer(0)
    n <- NROW(object)
    if (st > 1) 
        omit <- c(omit, 1:(st - 1))
    if (en < n) 
        omit <- c(omit, (en + 1):n)
    cl <- class(object)
    if (length(omit)) {
        object <- if (length(dim(object))) 
            object[st:en, ]
        else object[st:en]
        attr(omit, "class") <- "omit"
        attr(object, "na.action") <- omit
        if (!is.null(cl)) 
            class(object) <- cl
    }
    object
}
R/na.locf.R:60

na.contiguous.list untypeabletyped

unbound variable (line 96)
unbound: na.contiguous — a name the prelude does not declare
error detail
name: na.contiguous
gradual mode: typed
((object: any, ...: any) -> any)<>
timing: 0.003 s
source
na.contiguous.list <- function(object, ...)
	lapply(object, na.contiguous)
R/na.locf.R:95
R/na.spline.R

na.spline untypeabletyped

unbound variable (line 1)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((object: any, ...: any) -> any)<>
timing: 0.003 s
source
na.spline <- function(object, ...) UseMethod("na.spline")
R/na.spline.R:1

na.spline.default skipped

error detail
Invalid_argument("Variable ..._5 is already bound.")
timing: 0.099 s
source
na.spline.default <- function(object, x = index(object), xout = x, ..., na.rm = TRUE, maxgap = Inf, along) {

    if (!missing(along)) {
        warning("along to be deprecated - use x instead")
        if (missing(x)) x <- along
    }

    na.spline.vec <- function(x, y, xout = x, ...) {
        na <- is.na(y)
	if(sum(!na) < 1L) {
	    ## splinefun() cannot be applied here, hence simply:
	    yf <- rep.int(NA, length(xout))
	    mode(yf) <- mode(y)
	    if(any(!na)) {
	        if(x[!na] %in% xout) {
		    yf[xout == x[!na]] <- y[!na]
		}
	    }
	    return(yf)
	}
	if(all(!na) && (length(xout) > maxgap) && !all(xout %in% x)) {
	    ## for maxgap to work correctly 'y' has to contain
	    ## actual NAs and be expanded to the full x-index
	    xf <- sort(unique(c(x, xout)))
	    yf <- rep.int(NA, length(xf))
	    yf[MATCH(x, xf)] <- y
	    x <- xf
	    y <- yf
	}
        yf <- splinefun(x[!na], y[!na], ...)(xout)
        if (maxgap < length(y)) {
            ## construct a series like y but with only gaps > maxgap
            ## (actual values don't matter as we only use is.na(ygap) below)
            ygap <- .fill_short_gaps(y, seq_along(y), maxgap = maxgap)
            ## construct y values at 'xout', keeping NAs from ygap
            ## (using indexing, as approx() does not allow NAs to be propagated)
            ix <- splinefun(x, seq_along(y), ...)(xout)
            yx <- ifelse(is.na(ygap[floor(ix)] + ygap[ceiling(ix)]), NA, yf)
            yx
        } else {
            yf
        }
    }

    if (!identical(length(x), length(index(object)))) {
        stop("x and index must have the same length")
    }
    x. <- as.numeric(x)
    if (missing(xout) || is.null(xout)) xout <- x.
    xout. <- as.numeric(xout)
    object. <- coredata(object)

    result <- if (length(dim(object.)) < 2) {
        na.spline.vec(x., coredata(object.), xout = xout., ...)
    } else {
        apply(coredata(object.), 2, na.spline.vec, x = x., xout = xout., ...)
    }

    if (na.rm) {
        result <- na.trim(result, is.na = "all", maxgap = maxgap)
    }

    result

}
R/na.spline.R:49

na.spline.zoo skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.009 s
source
na.spline.zoo <- function(object, x = index(object), xout, ..., na.rm = TRUE, maxgap = Inf, along) {

    if (!missing(along)) {
        warning("along to be deprecated - use x instead")
        if (missing(x)) x <- along
    }

    missing.xout <- missing(xout) || is.null(xout)
    if (is.function(x)) x <- x(index(object))
    if (!missing.xout && is.function(xout)) xout <- xout(index(object))
    order.by <- if (missing.xout) index(object) else xout
    xout <- if (missing.xout) x else xout

    if (missing.xout || identical(xout, index(object))) {
        result <- object
    } else {
        object.x <- object
        if (!identical(class(x), class(xout))) {
            index(object.x) <- as.numeric(x)
            xout <- as.numeric(xout)
        } else {
            index(object.x) <- x
        }
        objectm <- merge(object.x, zoo(, xout))
        if (length(dim(objectm)) == 2) colnames(objectm) <- colnames(object)
        result <- window(objectm, index = xout)
    }
    result[] <- na.spline.default(object, x = x, xout = xout, na.rm = FALSE, ..., maxgap = maxgap)
    if ((!missing(order.by) && !is.null(order.by)) || !missing.xout) {
        index(result) <- order.by
    }

    if (na.rm) {
        result <- na.trim(result, is.na = "all", maxgap = maxgap)
    }

    result

}
R/na.spline.R:3

na.spline.zooreg untypeabletyped

unbound variable (line 45)
unbound: na.spline — one of the package’s own names, itself untyped
error detail
name: na.spline
gradual mode: typed
((object: any, ...: any) -> any)<>
timing: 0.059 s
source
na.spline.zooreg <- function(object, ...) {
    object. <- structure(object, class = setdiff(class(object), "zooreg"))
    as.zooreg(na.spline(object., ...))
}
R/na.spline.R:43

na.spline.ts untypeabletyped

unbound variable (line 116)
unbound: as.zoo — one of the package’s own names, itself untyped
error detail
name: as.zoo
gradual mode: typed
((object: any, ...: any) -> any)<>
timing: 0.004 s
source
na.spline.ts <- function(object, ...) {
    as.ts(na.spline(as.zoo(object), ...))
}
R/na.spline.R:115
R/plot.zoo.R

make.par.list untypeabletimeout

unbound variable (line 1)
unbound: unnamed — a name the prelude does not declare
error detail
name: unnamed
gradual mode: timeout
timing: 0.209 s
source
make.par.list <- function(nams, x, n, m, def, recycle = sum(unnamed) > 0) {
##FIXME: should defaults for n, m, def be available?

# if nams are the names of our variables and x is a parameter
# specification such as list(a = c(1,2), c(3,4)) then 
# create a new list which uses the named variables from x
# and assigns the unnamed in order.  For the remaining variables
# assign them the default value if recycle = FALSE or recycle the
# unnamed variables if recycle = TRUE.  The default value for
# recycle is TRUE if there is at least one unnamed variable
# in x and is false if there are only named variables in x.
# n is the length of the series and m is the total number of series
# It only needs to know whether m is 1 or greater than m.
# def is the default value used when recycle = FALSE
# recycle = TRUE means recycle unspecified values
# recycle = FALSE means replace values for unspecified series with def
# Within series recycling is done even if recycle=FALSE.
  # Should we allow arbirary names in 1d case?
  # if (m > 1) stopifnot(all(names(x) %in% c("", nams)))
  if (!is.list(x)) x <- if (m == 1) list(x) else as.list(x)
  y <- vector(mode = "list", length = length(nams))
  names(y) <- nams
  in.x <- nams %in% names(x)
  unnamed <- if (is.null(names(x))) rep(TRUE, length(x)) else names(x) == ""
  if (!recycle) y[] <- def
  y[in.x] <- x[nams[in.x]]
  if (recycle) {
    stopifnot(sum(unnamed) > 0)
    y[!in.x] <- rep(x[unnamed], length.out = sum(!in.x)) ## CHECK, this was: x[unnamed]
  } else {
    y[which(!in.x)[seq_len(sum(unnamed))]] <- x[unnamed]
  }
  lapply(y, function(y) if (length(y)==1) y else rep(y, length.out = n))
}
R/plot.zoo.R:1

plot.zoo skipped

error detail
Invalid_argument("Variable ..._5 is already bound.")
timing: 2.00 s
source
plot.zoo <- function(x, y = NULL, screens, plot.type, panel = lines, 
  xlab = "Index", ylab = NULL, main = NULL, xlim = NULL, ylim = NULL,
  xy.labels = FALSE, xy.lines = NULL, yax.flip = FALSE,
  oma = c(6, 0, 5, 0), mar = c(0, 5.1, 0, if(yax.flip) 5.1 else 2.1), 
  col = 1, lty = 1, lwd = 1, pch = 1, type = "l", log = "",
  nc, widths = 1, heights = 1, ...)
{
  ## if y supplied: scatter plot y ~ x
  if(!is.null(y)) {
    if(NCOL(x) > 1 || NCOL(y) > 1) stop("scatter plots only for univariate zoo series")
    xyzoo <- merge.zoo(x, y, all = FALSE)
    xy <- coredata(xyzoo)
    xy <- xy.coords(xy[,1], xy[,2])

    xlab <- if(missing(xlab)) deparse(substitute(x)) else xlab
    ylab <- if(missing(ylab)) deparse(substitute(y)) else ylab
    xlim <- if(is.null(xlim)) range(xy$x[is.finite(xy$x)]) else xlim
    ylim <- if(is.null(ylim)) range(xy$y[is.finite(xy$y)]) else ylim
    if(is.null(main)) main <- ""
    do.lab <- if(is.logical(xy.labels)) xy.labels else TRUE
    if(is.null(xy.lines)) xy.lines <- do.lab
    ptype <- if(do.lab) "n" else if(missing(type)) "p" else type

    plot.default(xy, type = ptype,col = col, pch = pch, main = main,
      xlab = xlab, ylab = ylab, xlim = xlim, ylim = ylim, log = log, ...)
    if(do.lab) text(xy, col = col,
      labels = if(!is.logical(xy.labels)) xy.labels else index2char(index(xyzoo)), ...)
    if(xy.lines) lines(xy, col = col, lty = lty, lwd = lwd, type = if(do.lab) "c" else "l", ...)

    return(invisible(xyzoo))
  }
  ## Else : no y, only x

  recycle <- function(a, len, nser)
     rep(lapply(as.list(a), rep, length.out = len), length.out = nser)
  # same as range except it passes pairs through
  range2 <- function(x, ...) if (length(x) == 2) x else range(x, ...)
  if (missing(plot.type)) {
	plot.type <- if (missing(screens)) "multiple"
	else if (length(unique(screens) == 1)) "single" 
	else "multiple"
  }
  plot.type <- match.arg(plot.type, c("multiple", "single"))
  nser <- NCOL(x)
  if (missing(screens)) {
	screens <- if (plot.type == "single") 1 else seq_len(nser)
  }	
  dots <- list(...)
  x.index <- index(x)
  if(is.ts(x.index)) x.index <- as.vector(x.index)
  cn <- if (is.null(colnames(x))) paste("V", seq_len(nser), sep = "")
	  else colnames(x)

  screens <- make.par.list(cn, screens, NROW(x), nser, 1)
  screens <- as.factor(unlist(screens))[drop = TRUE]
  ngraph <- length(levels(screens))
  if(nser > 1 && (plot.type == "multiple" || ngraph > 1)) {
    if (ngraph == 1) { 
	screens <- as.factor(seq(nser))
	ngraph <- nser
    }
    if(is.null(main)) main <- deparse(substitute(x))
    main.outer <- TRUE
    if(is.null(ylab)) ylab <- colnames(x)[!duplicated(screens)]
    if(is.null(ylab)) ylab <- paste("Series", which(!duplicated(screens)))
    if(is.call(ylab)) ylab <- as.expression(ylab)
    ylab <- rep(ylab, length.out = ngraph)
    if(!is.list(ylab)) ylab <- as.list(ylab)
    lty <- rep(lty, length.out = nser)
    lwd <- rep(lwd, length.out = nser)
    col <- make.par.list(cn, col, NROW(x), nser, 1)
    pch <- make.par.list(cn, pch, NROW(x), nser, par("pch"))
    type <- make.par.list(cn, type, NROW(x), nser, "l")
    if (!is.null(ylim)) {
        if (is.list(ylim)) ylim <- lapply(ylim, range2, na.rm = TRUE)
	else ylim <- list(range2(ylim, na.rm = TRUE))
	ylim <- lapply(make.par.list(cn, ylim, 2, nser, NULL), function(x) 
		if (is.null(x) || length(na.omit(x)) == 0) NULL 
		else range2(x, na.rm = TRUE))
    }
    panel <- match.fun(panel)
    if(missing(nc)) nc <- if(ngraph >  4) 2 else 1
    oldpar <- par(no.readonly = TRUE)
    on.exit({ par(oldpar) })
    nr <- ceiling(ngraph / nc)
    layout(matrix(seq(nr*nc), nr), widths = widths, heights = heights)
    par(mar = mar, oma = oma)
	# TRUE if all elements of L are the same -- else FALSE
	allsame <- function(L) {
		f <- function(x, y) if (identical(x, y)) x
		!is.null(Reduce(f, L))
	}
	# idx is vector of indices into ylim.  
	# If the entries indexed by it are all the same then use that common value;
	# otherwise, if the ylim are specified use the range of the ylim values;
	# otherwise, use the range of the data
	f <- function(idx) if (allsame(ylim)) ylim[idx][[1]]
		else if (!is.null(ylim) && length(idx) > 0 && 
			length(unlist(ylim[idx])) > 0) range(ylim[idx], finite = TRUE)
		else range(x[, idx], na.rm = TRUE)
	# ranges is indexed by screen
	ranges <- tapply(1:ncol(x), screens, f)
    for(j in seq_along(levels(screens))) {
      panel.number <- j
      y.side <- if (j %% 2 || !yax.flip) 2 else 4
      range. <- rep(ranges[[j]], length.out = length(time(x)))
      if(j%%nr==0 || j == length(levels(screens))) {
			args <- list(x.index, range., xlab = "", ylab = "", yaxt = "n",
				xlim = xlim, ylim = ylim[[j]], log = log, ...)
			args$type <- "n"
			do.call("plot", args)
			mtext(xlab, side = 1, line = 3)
      } else {      
			args <- list(x.index, range., xaxt = "n", yaxt = "n", xlab = "", 
				ylab = "", xlim = xlim, ylim = ylim[[j]], log = log, ...)
			args$type <- "n"
			do.call("plot", args)
			if ("bty" %in% names(args) && args$bty == "n") {} else box()
      }
      do.call("axis", c(list(side = y.side, xpd = NA), dots))
      mtext(ylab[[j]], y.side, line = 3)

      for(i in which(screens == levels(screens)[j])) {
        ## for potential usage in panel function
        series.number <- i
        series.within.screen <- ave(seq_along(screens), screens, FUN = seq_along)[series.number]
       
        ## draw individual lines/points with panel function
        panel(x.index, x[, i], col = col[[i]], pch = pch[[i]], lty = lty[i], lwd = lwd[i], type = type[[i]], ...)
      }
    }
  } else {
    if(is.null(ylab)) ylab <- deparse(substitute(x))
    if(is.call(ylab)) ylab <- as.expression(ylab)
    if(is.null(main)) main <- ""
    main.outer <- FALSE
    if(is.null(ylim)) ylim <- range(x, na.rm = TRUE)
	else ylim <- range2(c(ylim, recursive = TRUE), na.rm = TRUE)

    lty <- rep(lty, length.out = nser)
	lwd <- rep(lwd, length.out = nser)
    col <- make.par.list(cn, col, NROW(x), nser, 1)
    pch <- make.par.list(cn, pch, NROW(x), nser, par("pch"))
    type <- make.par.list(cn, type, NROW(x), nser, "l")
   
    dummy <- rep(range(x, na.rm = TRUE), 
	length.out = length(index(x)))
	    
    args <- list(x.index, dummy, xlab = xlab, ylab = ylab[1], ylim = ylim, xlim = xlim, log = log, ...)
    args$type <- "n"
    do.call("plot", args)
	if ("bty" %in% names(args) && args$bty == "n") {} else box()
    y <- as.matrix(x)
    for(i in 1:nser) {
      panel(x.index, y[, i], col = col[[i]], pch = pch[[i]], lty = lty[i], 
        lwd = lwd[i], type = type[[i]], ...)
    }
  }
  dots <- list(...)
  title.args <- c(list(main = main, outer = main.outer),
    dots[grep("[.]main$", names(dots))])
  do.call("title", title.args)
  return(invisible(x))
}
R/plot.zoo.R:36

lines.zoo untypeabletyped

unbound variable (line 204)
unbound: NCOL — a name the prelude does not declare
error detail
name: NCOL
gradual mode: typed
((x: any, y: null?, type: any?, ...: any) -> any)<>
timing: 0.046 s
source
lines.zoo <- function(x, y = NULL, type = "l", ...)
{
  if (is.null(y)) {
     if(NCOL(x) == 1) lines(index(x), x, type = type, ...)
       else stop("Can't plot lines for multivariate zoo object")
  } else
     lines(coredata(cbind(x,y)), type = type, ...)
}
R/plot.zoo.R:201

points.zoo untypeabletyped

unbound variable (line 211)
unbound: lines — a name the prelude does not declare
error detail
name: lines
gradual mode: typed
((x: any, y: any?, type: any?, ...: any) -> any)<>
timing: 0.017 s
source
points.zoo <- function(x, y = NULL, type = "p", ...)
  lines(x, y, type = type, ...)
R/plot.zoo.R:210

plot.tis untypeabletyped

unbound variable (line 214)
unbound: as.zoo — one of the package’s own names, itself untyped
error detail
name: as.zoo
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.005 s
source
plot.tis <- function(x, ...) eval.parent(substitute(plot(as.zoo(x), ...)))
R/plot.zoo.R:214

plot.ti untypeabletyped

unbound variable (line 218)
unbound: tis::POSIXct — a name the prelude does not declare
error detail
name: tis::POSIXct
gradual mode: typed
((x: any, y: any, xlab: any?, ...: any) -> any)<>
timing: 0.012 s
source
plot.ti <- function (x, y, xlab = "", ...) 
{
	x <- tis::POSIXct(x)
	NextMethod()
}
R/plot.zoo.R:216

points.ti untypeabletyped

unbound variable (line 223)
unbound: tis::POSIXct — a name the prelude does not declare
error detail
name: tis::POSIXct
gradual mode: typed
null
timing: 0.007 s
source
points.ti <- lines.ti <- function(x, ...) {
	x <- tis::POSIXct(x)
	NextMethod()
}
R/plot.zoo.R:222
R/read.zoo.R

read.zoo timeout

timing: 20.00 s
source
read.zoo <- function(file, format = "", tz = "", FUN = NULL,
  regular = FALSE, index.column = 1, drop = TRUE, FUN2 = NULL, 
  split = NULL, aggregate = FALSE, ..., text, read = read.table)
{

  if (missing(file) && !missing(text)) {
        file <- textConnection(text)
        on.exit(close(file))
  }

  ## if file is a vector of file names
  if (is.character(file) && length(file) > 1) {
	mc <- match.call()
	pf <- parent.frame()
	L <- sapply(file, function(file) eval(replace(mc, 2, file), pf), 
			simplify = FALSE)
	return(do.call("merge", L))
  }

  ## read data
  rval <- if (is.data.frame(file)) {
    if(inherits(file, "tbl")) as.data.frame(file) else file
  } else {
    read(file, ...)
  }

  ## if time index appears to be already processed, use FUN = identity
  if (is.data.frame(file) && 
      !identical(index.column, 0) &&
      !identical(index.column, 0L) &&
      length(index.column) == 1 && 
      !is.character(rval[[index.column]]) &&
      !is.factor(rval[[index.column]]) &&
      missing(tz) &&
      missing(format) &&
      missing(FUN)) FUN <- identity

  ## if time index is POSIXlt it is coerced to POSIXct
  if (is.data.frame(file) && 
      !identical(index.column, 0) &&
      !identical(index.column, 0L) &&
      length(index.column) == 1 && 
      inherits(rval[[index.column]], "POSIXlt")) rval[[index.column]] <- as.POSIXct(rval[[index.column]])

  # returns TRUE if a formal argument x has no default
  no.default <- function(x) typeof(x) %in% c("symbol", "language")

  if (is.null(FUN) && is.null(FUN2)) {
	index.column <- as.list(index.column)
  } else if (identical(FUN, paste)) {
	index.column <- as.list(index.column)
  } else if (is.null(FUN) && identical(FUN2, paste)) {
	index.column <- as.list(index.column)
  } else if (!is.null(FUN) && !is.list(index.column) && length(index.column) <=
		length(sapply(formals(match.fun(FUN)), no.default))) {
	index.column <- as.list(index.column)
  } else if (is.null(FUN) && !is.null(FUN2) && length(index.column) <= 
		length(sapply(formals(match.fun(FUN2)), no.default))) {
	index.column <- as.list(index.column)
  }

  if (is.list(index.column) && length(index.column) == 1 && 
	index.column[[1]] == 1) index.column <- unlist(index.column)

  is.index.column <- unname(unlist(index.column))
  is.index.column <- if(is.numeric(is.index.column)) {
     seq_along(rval) %in% is.index.column
  } else {
     seq_along(rval) %in% is.index.column | names(rval) %in% is.index.column
 }

  name.to.num <- function(x) if (is.character(x))
		match(x, names(rval), nomatch = 0) else x
  index.column <- if (is.list(index.column)) index.column <- 
	lapply(index.column, name.to.num)
  else name.to.num(index.column)

  ## convert factor columns in index to character
  is.fac <- sapply(rval, is.factor)
  is.fac.index <- is.fac & is.index.column
  if (any(is.fac.index)) rval[is.fac.index] <- 
	lapply(rval[is.fac.index], as.character)

  ## if file does not contain index or data
  if(NROW(rval) < 1) {
    if(is.data.frame(rval)) rval <- as.matrix(rval)
    if(NCOL(rval) > 1) rval <- rval[, ! is.index.column, drop = drop]
    rval2 <- zoo(rval)
    return(rval2)
  }

  ## extract index
  if(NCOL(rval) < 1) stop("data file must specify at least one column")
  
  ## extract index, retain rest of the data
  ix <- if (identical(index.column, 0) || identical(index.column, list(0)) ||
	identical(index.column, 0L) || identical(index.column, list(0L))) {
	attributes(rval)$row.names
  } else if (is.list(index.column)) {
	sapply(index.column, function(j) rval[,j], simplify = FALSE)
  } else rval[,index.column]

  # split. is col number of split column (or Inf, -Inf or NULL)
  split. <- if (is.character(split)) match(split, colnames(rval), nomatch = 0)
  else split

  rval2 <- if (is.null(split.)) {
    rval[ , ! is.index.column, drop = FALSE]
  } else {

     split.values <- if (is.character(split) || all(is.finite(split))) rval[, split]
	 else {
		# Inf: first value in each run is first series, etc.
	    # -Inf: last value in each run is first series, etc.
		if (identical(split, Inf)) ave(ix, ix, FUN = seq_along)
	    else if (identical(split, -Inf)) ave(ix, ix, FUN = function(x) rev(seq_along(x)))
	    else ix
	 }

	 if (0 %in% split.) {
		stop(paste("split:", split, "not found in colnames:", colnames(rval)))
	 }
	 rval[,-c(if (all(is.finite(split.))) split. else 0, which(is.index.column)), drop = FALSE]
  }

  if(is.factor(ix)) ix <- as.character(ix)
  rval3 <- if(is.data.frame(rval2)) as.matrix(rval2) else  if(is.list(rval2)) t(rval2) else rval2
  
  if(NCOL(rval3) == 1 && drop) rval3 <- drop(rval3)

    
  ## index transformation functions

  toDate <- if(missing(format) || is.null(format)) {
     function(x, ...) as.Date(format(x, scientific = FALSE))
  } else {
     function(x, format) {
       if(any(sapply(c("%H", "%M", "%S"), function(y) grepl(y, format, fixed = TRUE)))) {
         warning("the 'format' appears to be for a date/time, please specify 'tz' if you want to create a POSIXct time index")
       }
       as.Date(format(x, scientific = FALSE), format = format)
     }
  }

  toPOSIXct <- if (missing(format) || is.null(format)) {
        function(x, tz) as.POSIXct(format(x, scientific = FALSE), tz = tz)
  } else function(x, format, tz) {
        as.POSIXct(strptime(format(x, scientific = FALSE), tz = tz, format = format))
  }

  toDefault <- function(x, ...) {
    rval. <- try(toPOSIXct(x, tz = ""), silent = TRUE)
    if(inherits(rval., "try-error"))
      rval. <- try(toDate(x), silent = TRUE)
    else {
      hms <- as.POSIXlt(rval.)
      hms <- hms$sec + 60 * hms$min + 3600 * hms$hour
      if(isTRUE(all.equal(hms, rep.int(hms[1], length(hms))))) {
        rval2. <- try(toDate(x), silent = TRUE)
        if(!inherits(rval2., "try-error")) rval. <- rval2.
      }
    }
    if(inherits(rval., "try-error")) rval. <- rep(NA, length(x))
    return(rval.)
  }

  toNumeric <- function(x, ...) x
  
  ## setup default FUN

  if ((missing(FUN) || is.null(FUN)) && !missing(FUN2) && !is.null(FUN2)) {
	FUN <- FUN2
	FUN2 <- NULL
  }

  FUN0 <- NULL
  if(is.null(FUN)) {
	if (is.list(index.column)) FUN0 <- paste
    FUN <- if (!missing(tz) && !is.null(tz)) toPOSIXct
        else if (!missing(format) && !is.null(format)) toDate
        else if (is.numeric(ix)) toNumeric
        else toDefault
  }

  FUN <- match.fun(FUN)

 processFUN <- function(...) {
	if (is.data.frame(..1)) FUN(...)
	else if (is.list(..1)) {
		if (is.null(FUN0)) do.call(FUN, c(...))
		else {
			L <- list(...)
			L[[1]] <- do.call(FUN0, L[[1]])
			do.call(FUN, L)
		}
	} else FUN(...)
  }

  ## compute index from (former) first column
  ix <- if (missing(format) || is.null(format)) {
    if (missing(tz) || is.null(tz)) processFUN(ix) else processFUN(ix, tz = tz)
R/read.zoo.R:1

read.table.zoo untypeabletyped

unbound variable (line 270)
unbound: read.table — a name the prelude does not declare
error detail
name: read.table
gradual mode: typed
((file: any, format: any?, tz: any?, FUN: any?, regular: any?, index.column: any?, drop: any?, FUN2: any?, split: any?, aggregate: any?, ...: any) -> any)<>
timing: 0.287 s
source
read.table.zoo <- function(file, format = "", tz = "", FUN = NULL,
  regular = FALSE, index.column = 1, drop = TRUE, FUN2 = NULL, 
  split = NULL, aggregate = FALSE, ...)
{
  file <- read.table(file, ...)
  read.zoo(file, format = format, tz = tz, FUN = FUN, regular = regular,
    index.column = index.column, drop = drop, FUN2 = FUN2, 
    split = split, aggregate = aggregate)
  
}
R/read.zoo.R:266

read.csv.zoo skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
read.csv.zoo <- function(..., read = read.csv) {
  read.zoo(..., read = read)
}
R/read.zoo.R:277

read.csv2.zoo skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
read.csv2.zoo <- function(..., read = read.csv2) {
  read.zoo(..., read = read)
}
R/read.zoo.R:281

read.delim.zoo skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
read.delim.zoo <- function(..., read = read.delim) {
  read.zoo(..., read = read)
}
R/read.zoo.R:285

read.delim2.zoo skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.018 s
source
read.delim2.zoo <- function(..., read = read.delim2) {
  read.zoo(..., read = read)
}
R/read.zoo.R:289

write.zoo untypeable

unbound variable (line 296)
unbound: colnames — a name the prelude does not declare
error detail
name: colnames
timing: 0.184 s
source
write.zoo <- function(x, file = "", index.name = "Index",
  row.names = FALSE, col.names = NULL, FUN = format, ...)
{
  if(is.null(col.names)) col.names <- !is.null(colnames(x))
  dx <- as.data.frame(x)  
  stopifnot(all(names(dx) != index.name))
  dx[[index.name]] <- FUN(index(x))
  dx <- dx[, c(ncol(dx), 1:(ncol(dx)-1))]
  write.table(dx, file = file, row.names = row.names, col.names = col.names, ...)
}
R/read.zoo.R:293
R/rollmean.R

rollmean untypeabletyped

unbound variable (line 11)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, k: any, fill: any?, na.pad: any?, align: any?, ...: any) -> any)<>
timing: 0.141 s
source
rollmean <- function(x, k, fill = if (na.pad) NA, na.pad = FALSE, 
	align = c("center", "left", "right"), ...) {
	UseMethod("rollmean")
}
R/rollmean.R:9

rollmeanr skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
rollmeanr <- function(..., align = "right") {
	rollmean(..., align = align)
}
R/rollmean.R:5

rollmean.zoo skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.001 s
source
rollmean.zoo <- function(x, k, fill = if (na.pad) NA, na.pad = FALSE, 
	align = c("center", "left", "right"), ...) {

  if (length(x) < 1L) return(x)

  if (!missing(na.pad)) warning("na.pad is deprecated. Use fill.")

  align <- match.arg(align)

  n <- length(index(x))
  k <- trunc(k)
  if(k > n || anyNA(coredata(x))) return(rollapply(x, k, FUN = (mean), fill = fill, align = align, ...))

  if (length(dim(x)) == 2) {
	  # merge is the only zoo specific part of this method
	  
	  out <- do.call("merge", c(lapply(1:NCOL(x), function(i) {
		rollmean(x[, i, drop = TRUE], k, fill = fill, align = align, ...)
	  }), all = FALSE))
	  if (ncol(x) == 1) dim(out) <- c(length(out), 1)
	  colnames(out) <- colnames(x)
	  return(out)
  }

  ix <- switch(align,
      "left" = { 1:(n-k+1) },
      "center" = { floor((1+k)/2):ceiling(n-k/2) },
      "right" = { k:n })

  xu <- unclass(x)
  y <- xu[k:n] - xu[c(1, seq_len(n-k))] # difference from previous
  y[1] <- sum(xu[1:k])		 # find the first
  # sum precomputed differences
  rval <- cumsum(y)/k

  x[ix] <- rval
  na.fill(x, fill = fill, ix)

}
R/rollmean.R:14

rollmean.default untypeabletyped

unbound variable (line 59)
unbound: zoo — one of the package’s own names, itself untyped
error detail
name: zoo
gradual mode: typed
((x: any, k: any, fill: any?, na.pad: any?, align: any?, ...: any) -> any)<>
timing: 0.402 s
source
rollmean.default <- function(x, k, fill = if (na.pad) NA, na.pad = FALSE, 
	align = c("center", "left", "right"), ...)
{		
		if (length(x) < 1L) return(x)

		coredata(rollmean(zoo(x), k, fill = fill, align = align, ...))
}
R/rollmean.R:54

rollmean.ts untypeabletyped

unbound variable (line 66)
unbound: as.zoo — one of the package’s own names, itself untyped
error detail
name: as.zoo
gradual mode: typed
((x: any, k: any, fill: any?, na.pad: any?, align: any?, ...: (absent, any)) -> any)<>
timing: 0.354 s
source
rollmean.ts <- function(x, k, fill = if (na.pad) NA, na.pad = FALSE, 
	align = c("center", "left", "right"), ...)
{
		if (length(x) < 1L) return(x)
		as.ts(rollmean(as.zoo(x), k, fill = fill, align = align, ...))
}
R/rollmean.R:62

rollsum untypeabletyped

unbound variable (line 75)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, k: any, fill: any?, na.pad: any?, align: any?, ...: any) -> any)<>
timing: 0.143 s
source
rollsum <- function(x, k, fill = if (na.pad) NA, na.pad = FALSE, 
	align = c("center", "left", "right"), ...) {
	UseMethod("rollsum")
}
R/rollmean.R:73

rollsumr skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
rollsumr <- function(..., align = "right") {
	rollsum(..., align = align)
}
R/rollmean.R:69

rollsum.zoo skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.001 s
source
rollsum.zoo <- function(x, k, fill = if (na.pad) NA, na.pad = FALSE, 
	align = c("center", "left", "right"), ...)
{
  if (length(x) < 1L) return(x)

  if (!missing(na.pad)) warning("na.pad is deprecated. Use fill.")

  align <- match.arg(align)

  n <- length(index(x))
  k <- trunc(k)
  if(k > n || anyNA(coredata(x))) return(rollapply(x, k, FUN = (sum), fill = fill, align = align, ...))

  if (length(dim(x)) == 2) {
	  # merge is the only zoo specific part of this method
	  
	  out <- do.call("merge", c(lapply(1:NCOL(x), function(i) {
		rollsum(x[, i, drop = TRUE], k, fill = fill, align = align, ...)
	  }), all = FALSE))
	  if (ncol(x) == 1) dim(out) <- c(length(out), 1)
	  colnames(out) <- colnames(x)
	  return(out)
  }

  ix <- switch(align,
      "left" = { 1:(n-k+1) },
      "center" = { floor((1+k)/2):ceiling(n-k/2) },
      "right" = { k:n })

  xu <- unclass(x)
  y <- xu[k:n] - xu[c(1, seq_len(n-k))] # difference from previous
  y[1] <- sum(xu[1:k])		 # find the first
  # sum precomputed differences
  rval <- cumsum(y)

  x[ix] <- rval
  na.fill(x, fill = fill, ix)

}
R/rollmean.R:78

rollsum.default untypeabletyped

unbound variable (line 123)
unbound: zoo — one of the package’s own names, itself untyped
error detail
name: zoo
gradual mode: typed
((x: any, k: any, fill: any?, na.pad: any?, align: any?, ...: any) -> any)<>
timing: 0.368 s
source
rollsum.default <- function(x, k, fill = if (na.pad) NA, na.pad = FALSE, 
	align = c("center", "left", "right"), ...)
{
		if (length(x) < 1L) return(x)
		
		coredata(rollsum(zoo(x), k, fill = fill, align = align, ...))
}
R/rollmean.R:118

rollsum.ts untypeabletyped

unbound variable (line 130)
unbound: as.zoo — one of the package’s own names, itself untyped
error detail
name: as.zoo
gradual mode: typed
((x: any, k: any, fill: any?, na.pad: any?, align: any?, ...: (absent, any)) -> any)<>
timing: 0.357 s
source
rollsum.ts <- function(x, k, fill = if (na.pad) NA, na.pad = FALSE, 
	align = c("center", "left", "right"), ...)
{
		if (length(x) < 1L) return(x)
		as.ts(rollsum(as.zoo(x), k, fill = fill, align = align, ...))
}
R/rollmean.R:126

rollmax untypeabletyped

unbound variable (line 139)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, k: any, fill: any?, na.pad: any?, align: any?, ...: any) -> any)<>
timing: 0.160 s
source
rollmax <- function(x, k, fill = if (na.pad) NA, na.pad = FALSE, 
	align = c("center", "left", "right"), ...) {
	UseMethod("rollmax")
}
R/rollmean.R:137

rollmaxr skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
rollmaxr <- function(..., align = "right") {
	rollmax(..., align = align)
}
R/rollmean.R:133

rollmax.zoo skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.001 s
source
rollmax.zoo <- function(x, k, fill = if (na.pad) NA, na.pad = FALSE, 
	align = c("center", "left", "right"), ...)
{
  if (length(x) < 1L) return(x)

  if (!missing(na.pad)) warning("na.pad is deprecated. Use fill.")

  align <- match.arg(align)

  if (length(dim(x)) == 2) {
	  # merge is the only zoo specific part of this method
	  out <- do.call("merge", c(lapply(1:NCOL(x), function(i) {
		rollmax(x[, i, drop = TRUE], k, fill = fill, align = align, ...)
	  }), all = FALSE))
	  if (ncol(x) == 1) dim(out) <- c(length(out), 1)
	  colnames(out) <- if (ncol(x) == ncol(out)) colnames(x)
	  return(out)
  }

  n <- length(x)
  k <- trunc(k)
  if(k > n) return(rollapply(x, k, FUN = (max), fill = fill, align = align, ...))

  ix <- switch(align,
      "left" = { 1:(n-k+1) },
      "center" = { floor((1+k)/2):ceiling(n-k/2) },
      "right" = { k:n })

  n <- length(x) 
  rval <- rep(0, n) 
  a <- 0
  xc <- coredata(x)
  if(k == 1) {
    rval <- xc
  } else {
    for (i in k:n) {
      rval[i] <- if (is.na(a) || is.na(rval[i-1]) || a==rval[i-1]) 
        max(xc[(i-k+1):i]) # calculate max of window
      else 
        max(rval[i-1], xc[i]); # max of window = rval[i-1] 
      a <- xc[i-k+1] # point that will be removed from window
    }
    rval <- rval[-seq(k-1)]
  }

  x[ix] <- rval
  na.fill(x, fill = fill, ix)

}
R/rollmean.R:142

rollmax.default untypeabletyped

unbound variable (line 197)
unbound: zoo — one of the package’s own names, itself untyped
error detail
name: zoo
gradual mode: typed
((x: any, k: any, fill: any?, na.pad: any?, align: any?, ...: any) -> any)<>
timing: 0.381 s
source
rollmax.default <- function(x, k, fill = if (na.pad) NA, na.pad = FALSE, 
	align = c("center", "left", "right"), ...)
{
		if (length(x) < 1L) return(x)
		
		coredata(rollmax(zoo(x), k, fill = fill, align = align, ...))
}
R/rollmean.R:192

rollmax.ts untypeabletyped

unbound variable (line 205)
unbound: as.zoo — one of the package’s own names, itself untyped
error detail
name: as.zoo
gradual mode: typed
((x: any, k: any, fill: any?, na.pad: any?, align: any?, ...: (absent, any)) -> any)<>
timing: 0.364 s
source
rollmax.ts <- function(x, k, fill = if (na.pad) NA, na.pad = FALSE, 
	align = c("center", "left", "right"), ...)
{
		if (length(x) < 1L) return(x)
		
		as.ts(rollmax(as.zoo(x), k, fill = fill, align = align, ...))
}
R/rollmean.R:200

rollmedian untypeabletyped

unbound variable (line 215)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, k: any, fill: any?, na.pad: any?, align: any?, ...: any) -> any)<>
timing: 0.141 s
source
rollmedian <- function(x, k, fill = if (na.pad) NA, na.pad = FALSE, 
	align = c("center", "left", "right"), ...) {
	UseMethod("rollmedian")
}
R/rollmean.R:213

rollmedianr skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
rollmedianr <- function(..., align = "right") {
	rollmedian (..., align = align)
}
R/rollmean.R:209

rollmedian.zoo skipped

error detail
Failure("Unsupported positional argument after a named one.")
timing: 0.001 s
source
rollmedian.zoo <- function(x, k, fill = if (na.pad) NA, na.pad = FALSE, 
	align = c("center", "left", "right"), ...)
{
  if (length(x) < 1L) return(x)

  if (!missing(na.pad)) warning("na.pad is deprecated. Use fill.")

  align <- match.arg(align)

  n <- length(index(x))
  k <- trunc(k)
  if(k > n || anyNA(coredata(x))) return(rollapply(x, k, FUN = (median), fill = fill, align = align, ...))

  if (length(dim(x)) == 2) {
	  # merge is the only zoo specific part of this method
	  out <- do.call("merge", c(lapply(1:NCOL(x), function(i) {
		rollmedian(x[, i, drop = TRUE], k, fill = fill, align = align, ...)
	  }), all = FALSE))
	  if (ncol(x) == 1) dim(out) <- c(length(out), 1)
	  colnames(out) <- colnames(x)
	  return(out)
  }

  ix <- switch(align,
      "left" = { 1:(n-k+1) },
      "center" = { floor((1+k)/2):ceiling(n-k/2) },
      "right" = { k:n })

  m <- k %/% 2
  rval <- runmed(x, k, ...)
  attr(rval, "k") <- NULL
  if(m >= 1) rval <- rval[-c(1:m, (n-m+1):n)]

  x[ix] <- rval
  na.fill(x, fill = fill, ix)

}
R/rollmean.R:218

rollmedian.default untypeabletyped

unbound variable (line 261)
unbound: zoo — one of the package’s own names, itself untyped
error detail
name: zoo
gradual mode: typed
((x: any, k: any, fill: any?, na.pad: any?, align: any?, ...: any) -> any)<>
timing: 0.352 s
source
rollmedian.default <- function(x, k, fill = if (na.pad) NA, na.pad = FALSE, 
	align = c("center", "left", "right"), ...)
{
		if (length(x) < 1L) return(x)
		
		coredata(rollmedian(zoo(x), k, fill = fill, align = align, ...))
}
R/rollmean.R:256

rollmedian.ts untypeabletyped

unbound variable (line 269)
unbound: as.zoo — one of the package’s own names, itself untyped
error detail
name: as.zoo
gradual mode: typed
((x: any, k: any, fill: any?, na.pad: any?, align: any?, ...: (absent, any)) -> any)<>
timing: 0.383 s
source
rollmedian.ts <- function(x, k, fill = if (na.pad) NA, na.pad = FALSE, 
	align = c("center", "left", "right"), ...)
{
		if (length(x) < 1L) return(x)
		
		as.ts(rollmedian(as.zoo(x), k, fill = fill, align = align, ...))
}
R/rollmean.R:264
R/rollapply.R

rollapply untypeabletyped

unbound variable (line 36)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((data: any, ...: any) -> any)<>
timing: 0.004 s
source
rollapply <- function(data, ...) UseMethod("rollapply")
R/rollapply.R:36

rollapplyr skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
rollapplyr <- function(..., align = "right") {
	rollapply(..., align = align)
}
R/rollapply.R:32

rollapply.default untypeabletyped

unbound variable (line 40)
unbound: zoo — one of the package’s own names, itself untyped
error detail
name: zoo
gradual mode: typed
((data: any, ...: any) -> any)<>
timing: 0.033 s
source
rollapply.default <- function(data, ...) {
        if (length(data) < 1L) return(data)
	coredata(rollapply(zoo(data), ...))
}
R/rollapply.R:38

rollapply.ts untypeabletyped

unbound variable (line 45)
unbound: as.zoo — one of the package’s own names, itself untyped
error detail
name: as.zoo
gradual mode: typed
((data: any, ...: any) -> any)<>
timing: 0.033 s
source
rollapply.ts <- function(data, ...) {
        if (length(data) < 1L) return(data)
	as.ts(rollapply(as.zoo(data), ...))
}
R/rollapply.R:43

rollapply.zoo skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.099 s
source
rollapply.zoo <- function(data, width, FUN, ..., by = 1, 
	by.column = TRUE, fill = if (na.pad) NA, na.pad = FALSE,
	partial = FALSE, align = c("center", "left", "right"), coredata = TRUE) {

        if (length(data) < 1L) return(data)

	if (!missing(na.pad)) {
		warning("na.pad argument is deprecated")
	}

    if (is.vector(width) && !is.list(width) && length(width) == 1 &&
		by.column && length(by) == 1 && by == 1 && (missing(partial) | identical(partial, FALSE)) &&
		length(list(...)) < 1 && length(sw <- deparse(substitute(FUN))) == 1) {
		  if (sw == "mean" && !anyNA(data)) {
				return(rollmean(data, width, fill = fill, align = align))
		  } else if (sw == "median" && width %% 2 == 1 && !anyNA(data)) {
				return(rollmedian(data, width, fill = fill, align = align))
	      } else if (sw == "max") {
				return(rollmax(data, width, fill = fill, align = align))
	      }
	}
	FUN <- match.fun(FUN)

	if (by.column && length(dim(data)) == 2) {
		z <- do.call(merge,
			lapply(1:NCOL(data), function(j)
				rollapply(data[, j, drop = TRUE], width = width, FUN = FUN, ...,
					by = by, by.column = by.column, fill = fill,
					partial = partial, align = align, coredata = coredata)
			)
		)
		if (NCOL(data) == 1) dim(z) <- c(length(z), 1)
		colnames(z) <- if (NCOL(z) == NCOL(data)) colnames(data)
		return(z)
	}

	if (is.logical(partial)) partial <- if (partial) 1 else -1

	# convert widths to offsets using align
	align <- match.arg(align)

	width <- if (!is.list(width)) {
	  lapply(trunc(width), function(w) {
			if (align == "right") seq(to = 0, length.out = w)
			else if (align == "center") seq(to = floor(w/2), length.out = w)
			else seq(from = 0, length.out = w)
	  })
	} else {
	  lapply(width, function(w) {
	                if(is.null(w)) NULL else trunc(w)
	  })
	}
	# recycle width (using by if length(width) == 1)
	width <- if (length(width) == 1) {
		w <- rep(list(NULL), NROW(data))
		start.at <- if (partial < 0) max(-min(width[[1]]), 0) + 1 else 1
		start.at <- min(NROW(data), start.at)
		replace(w, seq(start.at, NROW(data), by = by), width)
	} else rep(width, length.out = NROW(data))

	f <- if (is.null(dim(data))) {
		# undimensioned
		#
		# if FUN is to be evaluated at offsets for the ith point then calculate
		# positions, do partial processing and apply FUN
		function(i, offsets, data, ...) { 
			if (is.null(offsets)) return(NULL)
			posns <- i + offsets
			ix <- posns >= 1 & posns <= NROW(data)
			if (partial < 0) {
				if (all(ix)) FUN(data[posns], ...)
			} else if (sum(ix) >= partial) {
				FUN(data[replace(posns, !ix, 0)], ...)
			}
		}
        } else {
		# dimensioned
		#
		# same f as in TRUE leg except data[.] becomes data[.,]
		function(i, offsets, data, ...) { 
			if (is.null(offsets)) return(NULL)
			posns <- i + offsets
			ix <- posns >= 1 & posns <= NROW(data)
			if (partial < 0) {
				if (all(ix)) FUN(data[posns,], ...)
			} else if (sum(ix) >= partial) {
				FUN(data[replace(posns, !ix, 0),], ...)
			}
		}
	}

        dat <- if(coredata) coredata(data) else data
	dat <- mapply(f, seq_along(time(data)), width, 
		MoreArgs = list(data = dat, ...), SIMPLIFY = FALSE) 
		
	ix <- !sapply(dat, is.null) # integer indexes of non-nulls

        ## flatten data if output of FUN has a dim and > 1 row (e.g., matrix or data.frame)
        if(any(sapply(dat[ix], function(d) !is.null(nrow(d)) && nrow(d) > 1L))) {
	    dat[ix] <- lapply(dat[ix], function(d) unlist(as.data.frame(d)))
	}

	if (!missing(fill) || !missing(na.pad)) {

		# replace NULLs with NAs
		dat <- lapply(dat, function(x) if (is.null(x)) NA else x)

		# construct zoo object
		dat <-
		if (max(sapply(dat, length)) > 1)
			zoo(do.call("rbind", dat), index(data), attr(data, "frequency"))
		else
			zoo(do.call("c", dat), index(data), attr(data, "frequency"))

		# perform filling
		dat <- na.fill(dat, fill, ix)

	} else {

		# construct zoo object removing points corresponding to NULL
		dat <- if (max(sapply(dat, length)) > 1)
			zoo(do.call("rbind", dat), index(data)[ix], attr(data, "frequency"))
		else
			zoo(do.call("c", dat), index(data)[ix], attr(data, "frequency"))
	}

	dat
}
R/rollapply.R:48
R/tinyplot.zoo.R

tinyplot.zoo untypeabletyped

unbound variable (line 4)
unbound: substitute — a name the prelude does not declare
error detail
name: substitute
gradual mode: typed
((object: any, facet: any, type: any?, facet.args: any?, ylab: any?, ...: any) -> any)<>
timing: 0.198 s
source
tinyplot.zoo <- function(object, facet, type = "l", facet.args = list(free = TRUE), ylab = "", ...)
{
  ## convert to data.frame (and assure correct label processing by fortify.zoo)
  lab <- deparse(substitute(object))
  if(NCOL(object) == 1L) {
    if(is.null(dim(object))) dim(object) <- c(NROW(object), 1L)
    if(is.null(colnames(object))) colnames(object) <- lab
  }
  if(is.null(colnames(object))) colnames(object) <- paste(lab, 1:NCOL(object), sep = ".")
  df <- fortify.zoo(object, melt = TRUE)

  ## default for facet
  single <- nlevels(df$Series) == 1L
  if(missing(facet)) {
    auto <- TRUE
    facet <- if(single) NULL else ~ Series
  } else {
    auto <- FALSE
  }
  if (is.null(facet)) facet.args <- NULL
  
  ## call tinyplot
  if(single | (!is.null(facet) & auto)) {
    tinyplot::tinyplot(Value ~ Index, data = df, facet = facet, facet.args = facet.args, type = type, ylab = ylab, ...)
  } else {
    tinyplot::tinyplot(Value ~ Index | Series, data = df, facet = facet, facet.args = facet.args, type = type, ylab = ylab, ...)
  }
}
R/tinyplot.zoo.R:1
R/window.zoo.R

window.zoo untypeable

unbound variable (line 1)
unbound: index — one of the package’s own names, itself untyped
error detail
name: index
timing: 0.453 s
source
window.zoo <- function(x, index. = index(x), start = NULL, end = NULL, ...)
{
  all.indexes <- index(x)
  in.index <- MATCH(all.indexes, index., nomatch = 0) > 0

  if(length(start) == 2 && !is.null(attr(x, "frequency")) && is.numeric(all.indexes)) {
    freq <- attr(x, "frequency")
    start <- floor(start[1]*freq + (start[2] - 1) + .0001)/freq
  }
  if(length(end) == 2 && !is.null(attr(x, "frequency")) && is.numeric(all.indexes)) {
    freq <- attr(x, "frequency")
    end <- floor(end[1]*freq + (end[2] - 1) + .0001)/freq
  }

  if(is.null(start) || any(is.na(start))) {
    if(is.null(end) || any(is.na(end))) {
      wi <- which(MATCH(all.indexes, index., nomatch = 0) > 0)
      return(x[wi, , drop = FALSE])
    } else {
      wi <- which(in.index & all.indexes <= end)
      return(x[wi, , drop = FALSE])
    }
  } else {
    if(is.null(end) || any(is.na(end))) {
      wi <- which(in.index & all.indexes >= start)
    } else {
      wi <- which(in.index & all.indexes >= start & all.indexes <= end)
    }
    return(x[wi, , drop = FALSE])
  }
}
R/window.zoo.R:1

window<-.zoo untypeable

unbound variable (line 33)
unbound: index — one of the package’s own names, itself untyped
error detail
name: index
timing: 0.480 s
source
"window<-.zoo" <- function(x, index. = index(x), start = NULL, end = NULL, ..., value)
{
  ix <- index(x)
  stopifnot(all(MATCH(index., ix, nomatch = 0) > 0))
  
  if(length(start) == 2 && !is.null(attr(x, "frequency")) && is.numeric(ix)) {
    freq <- attr(x, "frequency")
    start <- floor(start[1]*freq + (start[2] - 1) + .0001)/freq
  }
  if(length(end) == 2 && !is.null(attr(x, "frequency")) && is.numeric(ix)) {
    freq <- attr(x, "frequency")
    end <- floor(end[1]*freq + (end[2] - 1) + .0001)/freq
  }
  
  if (!is.null(start) && !is.na(start)) index. <- index.[index. >= start]
  if (!is.null(end) && !is.na(end)) index. <- index.[index. <= end]

  wi <- which(MATCH(ix, index., nomatch = 0) > 0)
  if (length(dim(x)) == 0)
  	  x[wi] <- value
  else
  	  x[wi,] <- value
  return(x)
}
R/window.zoo.R:33

lag.zoo untypeable

unbound variable (line 62)
unbound: lag.zoo — one of the package’s own names, itself untyped
error detail
name: lag.zoo
timing: 0.224 s
source
lag.zoo <- function(x, k = 1, na.pad = FALSE, ...)
{
   if (length(k) > 1) {
	if (is.null(names(k))) names(k) <- paste("lag", k, sep = "")
	return(do.call("merge.zoo", lapply(k, lag.zoo, x = x, na.pad = na.pad, ...)))
   }
   nr <- NROW(x)
   if (k != round(k)) {
	k <- round(k)
	warning("k is not an integer")
   }
   if (k == 0) return(x)
   if (abs(k) > nr) k <- nr
   if (k > 0)  {
	   xx <- x[-seq(1, length.out = k),, drop = FALSE]
	   attr(xx, "index") <- index(x)[-seq(to = nr, length.out = k)]
   } else {
	   xx <- x[-seq(to = nr, length.out = -k),, drop = FALSE]
	   attr(xx, "index") <- index(x)[-seq(1, length.out = -k)]
   }
   if (na.pad) merge(zoo(,time(x)), xx, all = c(TRUE, FALSE)) else xx
}
R/window.zoo.R:58

lag.zooreg untypeable

unbound variable (line 87)
unbound: lag.zooreg — one of the package’s own names, itself untyped
error detail
name: lag.zooreg
timing: 0.204 s
source
lag.zooreg <- function(x, k = 1, na.pad = FALSE, ...)
{
   if (length(k) > 1) {
	if (is.null(names(k))) names(k) <- paste("lag", k, sep = "")
	return(do.call("merge.zoo", lapply(k, lag.zooreg, x = x, na.pad = na.pad, ...)))
   }
   x0 <- x
   nr <- NROW(x)
   freq <- attr(x, "frequency")
   
   if (k != round(k)) warning("k is not an integer")
   k <- round(k)

   ix <- index(x)
   ix <- if(identical(class(ix), "numeric") | identical(class(ix), "integer"))
     floor(freq*ix - k + .0001)/freq else ix - k/freq
   index(x) <- ix

   if (na.pad) merge(x, zoo(, time(x0))) else x
}
R/window.zoo.R:83

diff.zoo untypeabletimeout

unbound variable (line 106)
unbound: index — one of the package’s own names, itself untyped
error detail
name: index
gradual mode: timeout
timing: 0.294 s
source
diff.zoo <- function(x, lag = 1, differences = 1, arithmetic = TRUE, na.pad = FALSE, log = FALSE, ...)
{
    ix <- index(x)
    stopifnot(differences >= 1)
    
    ## for relative differences, use division only if 'x' contains negative values
    ## other numerically more stable log-transform
    if(arithmetic || all(coredata(x) > 0)) {
      if (!arithmetic || log) x <- log(x)
      if (lag > 0) for(i in 1:differences) x <- x - lag(x, k = -lag, ...) else for(i in 1:differences) x <- lag(x, k = -lag, ...) - x
      if (!arithmetic) x <- exp(x)
    } else {
      if (lag > 0) for(i in 1:differences) x <- x / lag(x, k = -lag, ...) else for(i in 1:differences) x <- lag(x, k = -lag, ...) / x    
    }
    if (na.pad) merge(zoo(,ix), x, all = c(TRUE, FALSE)) else x
}
R/window.zoo.R:104
R/xblocks.R

xblocks untypeabletyped

unbound variable (line 3)
unbound: UseMethod — a name the prelude does not declare
error detail
name: UseMethod
gradual mode: typed
((x: any, ...: any) -> any)<>
timing: 0.003 s
source
xblocks <- function(x, ...)
    UseMethod("xblocks")
R/xblocks.R:2

xblocks.default skipped

error detail
File "Rsem/lang/PAst.ml", line 210, characters 14-20: Assertion failed
timing: 0.000 s
source
xblocks.default <-
    function (x, y, ..., col = NULL, border = NA, 
              ybottom = par("usr")[3], ytop = ybottom + height,
              height = diff(par("usr")[3:4]),
              last.step = median(diff(tail(x))))
{
    if (is.function(y))
        y <- y(x)
    x <- as.numeric(x)
    if (length(x) == 0) return()
    if (is.unsorted(x, na.rm = TRUE))
        stop("'x' should be ordered (increasing)")
    if (is.na(last.step))
        last.step <- 0
    ## Three cases:
    ## (1) If y is character, assume it gives the block colours
    ## -- unless 'col' is given, which over-rides it.
    ## (2) If y is logical, show blocks of TRUE values.
    ## (3) If y is numeric, show blocks of non-NA values.
    if (is.logical(y)) {
        y <- y
    } else if (is.numeric(y)) {
        y <- !is.na(y)
    } else {
        ## this will convert factor, Date, etc to character:
        y <- as.character(y)
    }
    ## Note: rle treats each NA as unique (does not combine runs of NAs)
    ## so we need to replace NAs with a temporary value.
    NAval <-
        if (is.character(y)) "" else FALSE
    y[is.na(y)] <- NAval
    ## find blocks (runs of constant values)
    yrle <- rle(y)
    ## substitute NA values back in
    blockCol <- yrle$values
    blockCol[blockCol == NAval] <- NA
    ## for logical series, col default comes from palette()
    if (is.logical(y) && is.null(col))
        col <- palette()[1]
    ## set block colours if 'col' given
    if (length(col) > 0) {
        if (is.character(col))
            col[col == ""] <- NA
        ok <- !is.na(blockCol)
        blockCol[ok] <- rep(col, length.out = sum(ok)) ## rep to avoid warnings
    }
    ## work out block geometry
    idxBounds <- cumsum(c(1, yrle$lengths))
    idxStart <- head(idxBounds, -1)
    idxEnd <- tail(idxBounds, -1)
    idxEnd[length(idxEnd)] <- length(y)
    blockStart <- x[idxStart]
    blockEnd <- x[idxEnd]
    blockEnd[length(blockEnd)] <- tail(blockEnd, 1) + last.step
    blockWidth <- blockEnd - blockStart
    ## adjust for log scales
    if (par("ylog")) {
        ybottom <- 10^ybottom
        ytop <- 10^ytop
    }
    ## draw it
    rect(xleft = blockStart, xright = blockEnd,
         ybottom = ybottom, ytop = ytop,
         col = blockCol, border = border, ...)
}
R/xblocks.R:5

xblocks.zoo untypeabletyped

unbound variable (line 78)
unbound: index — one of the package’s own names, itself untyped
error detail
name: index
gradual mode: typed
null
timing: 0.138 s
source
xblocks.zoo <-
xblocks.ts <-
    function(x, y = x, ...)
{
    if (!is.function(y))
        y <- coredata(y)
    xblocks(index(x), y, ...)
}
R/xblocks.R:72
R/xyplot.zoo.R

panel.plot.default skipped

error detail
Failure("Unsupported argument after an ellipsis.")
timing: 0.000 s
source
panel.plot.default <- function(x, y, subscripts, groups, panel = panel.xyplot,
  col = 1, type = "p", pch = 20, lty = 1, lwd = 1, ...)
{
  col <- rep(as.list(col), length.out = nlevels(groups))
  type <- rep(as.list(type), length.out = nlevels(groups))
  pch <- rep(as.list(pch), length.out = nlevels(groups))
  lty <- rep(as.list(lty), length.out = nlevels(groups))
  lwd <- rep(as.list(lwd), length.out = nlevels(groups))

  for(g in 1:nlevels(groups)) {
    idx <- g == unclass(groups[subscripts])
    if (any(idx)) panel(x[idx], y[idx], ...,
      col = col[[g]], type = type[[g]], pch = pch[[g]],
      lty = lty[[g]], lwd = lwd[[g]])
  }
  .Deprecated(msg="panel.plot.default is no longer needed, just use panel.xyplot etc")
}
R/xyplot.zoo.R:1

panel.plot.custom skipped

error detail
Invalid_argument("Variable ..._5 is already bound.")
timing: 0.002 s
source
panel.plot.custom <- function(...) {
  args <- list(...)
  function(...) {
    dots <- list(...)
    do.call("panel.plot.default", modifyList(dots, args))
  }
}
R/xyplot.zoo.R:19

xyplot.its untypeabletyped

unbound variable (line 31)
unbound: as.zoo — one of the package’s own names, itself untyped
error detail
name: as.zoo
gradual mode: typed
null
timing: 0.019 s
source
xyplot.its <-
xyplot.ts <-
xyplot.zoo <- function(x, data, ...)
{
    obj <- lattice::xyplot.ts(as.zoo(x), ...)
    obj$call <- match.call()
    obj
}
R/xyplot.zoo.R:27

xyplot.tis untypeabletyped

unbound variable (line 38)
unbound: as.zoo — one of the package’s own names, itself untyped
error detail
name: as.zoo
gradual mode: typed
((x: any, data: any, ...: any) -> any)<>
timing: 0.008 s
source
xyplot.tis <- function(x, data, ...)
{
    x <- aggregate(as.zoo(x), tis::POSIXct, identity)
    obj <- lattice::xyplot.ts(x, ...)
    obj$call <- match.call()
    obj
}
R/xyplot.zoo.R:36

llines.its untypeabletyped

unbound variable (line 52)
unbound: time — a name the prelude does not declare
error detail
name: time
gradual mode: typed
null
timing: 0.146 s
source
llines.its <-
llines.tis <-
llines.zoo <- function(x, y = NULL, ...)
{
    if (!is.null(y)) {
        llines(coredata(x), y = y, ...)
    } else {
        llines(coredata(time(x)), y = coredata(x), ...)
    }
}
R/xyplot.zoo.R:45

lpoints.its untypeabletyped

unbound variable (line 63)
unbound: time — a name the prelude does not declare
error detail
name: time
gradual mode: typed
null
timing: 0.144 s
source
lpoints.its <-
lpoints.tis <-
lpoints.zoo <- function(x, y = NULL, ...)
{
    if (!is.null(y)) {
        lpoints(coredata(x), y = y, ...)
    } else {
        lpoints(coredata(time(x)), y = coredata(x), ...)
    }
}
R/xyplot.zoo.R:56

ltext.its untypeabletyped

unbound variable (line 74)
unbound: time — a name the prelude does not declare
error detail
name: time
gradual mode: typed
null
timing: 0.143 s
source
ltext.its <-
ltext.tis <-
ltext.zoo <- function(x, y = NULL, ...)
{
    if (!is.null(y)) {
        ltext(coredata(x), y = y, ...)
    } else {
        ltext(coredata(time(x)), y = coredata(x), ...)
    }
}
R/xyplot.zoo.R:67

panel.lines.ts untypeabletyped

unbound variable (line 83)
unbound: as.zoo — one of the package’s own names, itself untyped
error detail
name: as.zoo
gradual mode: typed
null
timing: 0.016 s
source
panel.lines.ts <- 
panel.lines.its <-
panel.lines.tis <-
panel.lines.zoo <- function(x, ...) {
  x <- as.zoo(x)
  panel.lines(time(x), coredata(x), ...)
  .Deprecated("panel.lines")
}
R/xyplot.zoo.R:79

panel.points.ts untypeabletyped

unbound variable (line 92)
unbound: as.zoo — one of the package’s own names, itself untyped
error detail
name: as.zoo
gradual mode: typed
null
timing: 0.016 s
source
panel.points.ts <- 
panel.points.its <-
panel.points.tis <-
panel.points.zoo <- function(x, ...) {
  x <- as.zoo(x)
  panel.points(time(x), coredata(x), ...)
  .Deprecated("panel.points")
}
R/xyplot.zoo.R:88

panel.text.ts untypeabletyped

unbound variable (line 101)
unbound: as.zoo — one of the package’s own names, itself untyped
error detail
name: as.zoo
gradual mode: typed
null
timing: 0.016 s
source
panel.text.ts <- 
panel.text.its <-
panel.text.tis <-
panel.text.zoo <- function(x, ...) {
  x <- as.zoo(x)
  panel.text(time(x), coredata(x), ...)
  .Deprecated("panel.text")
}
R/xyplot.zoo.R:97

panel.segments.ts untypeabletyped

unbound variable (line 110)
unbound: as.zoo — one of the package’s own names, itself untyped
error detail
name: as.zoo
gradual mode: typed
null
timing: 0.026 s
source
panel.segments.ts <- 
panel.segments.its <-
panel.segments.tis <-
panel.segments.zoo <- function(x0, x1, ...) {
  x0 <- as.zoo(x0)
  x1 <- as.zoo(x1)
  panel.segments(time(x0), coredata(x0), time(x1), coredata(x1), ...)
}
R/xyplot.zoo.R:106

panel.rect.ts untypeabletyped

unbound variable (line 119)
unbound: as.zoo — one of the package’s own names, itself untyped
error detail
name: as.zoo
gradual mode: typed
null
timing: 0.026 s
source
panel.rect.ts <- 
panel.rect.its <-
panel.rect.tis <-
panel.rect.zoo <- function(x0, x1, ...) {
  x0 <- as.zoo(x0)
  x1 <- as.zoo(x1)
  panel.rect(time(x0), coredata(x0), time(x1), coredata(x1), ...)
}
R/xyplot.zoo.R:115

panel.polygon.ts untypeabletyped

unbound variable (line 128)
unbound: as.zoo — one of the package’s own names, itself untyped
error detail
name: as.zoo
gradual mode: typed
null
timing: 0.015 s
source
panel.polygon.ts <- 
panel.polygon.its <-
panel.polygon.tis <-
panel.polygon.zoo <- function(x, ...) {
  x <- as.zoo(x)
  panel.polygon(time(x), coredata(x), ...)
}
R/xyplot.zoo.R:124
R/zzz.R

register_s3_method untypeable

untypeable assignment (line 6)
error detail
variable: fun
expected: null
given: any
expression may be: new.env()
timing: 1.46 s
source
register_s3_method <- function(pkg, generic, class, fun = NULL) {
  stopifnot(is.character(pkg), length(pkg) == 1L)
  stopifnot(is.character(generic), length(generic) == 1L)
  stopifnot(is.character(class), length(class) == 1L)

  if (is.null(fun)) {
    fun <- get(paste0(generic, ".", class), envir = parent.frame())
  } else {
    stopifnot(is.function(fun))
  }

  if (isNamespaceLoaded(pkg)) {
    registerS3method(generic, class, fun, envir = asNamespace(pkg))
  }

  # Always register hook in case package is later unloaded & reloaded
  setHook(
    packageEvent(pkg, "onLoad"),
    function(...) {
      registerS3method(generic, class, fun, envir = asNamespace(pkg))
    }
  )
}
R/zzz.R:1

.onLoad untypeabletyped

unbound variable (line 26)
unbound: getRversion — a name the prelude does not declare
error detail
name: getRversion
gradual mode: typed
((libname: any, pkgname: any) -> null)<>
timing: 0.011 s
source
.onLoad <- function(libname, pkgname) {
  if(getRversion() < "3.6.0") {
    register_s3_method("ggplot2", "autoplot", "zoo")
    register_s3_method("ggplot2", "fortify", "zoo")
    register_s3_method("ggplot2", "scale_type", "yearmon")
    register_s3_method("ggplot2", "scale_type", "yearqtr")
  }
  invisible()
}
R/zzz.R:25

.onUnload untypeabletyped

unbound variable (line 36)
unbound: library.dynam.unload — a name the prelude does not declare
error detail
name: library.dynam.unload
gradual mode: typed
((libpath: any) -> any)<>
timing: 0.002 s
source
.onUnload <- function(libpath) {
  library.dynam.unload("zoo", libpath)
}
R/zzz.R:35