R/base_stuff.R

"[.singular" <- function (x,...)
{
  cl <- class(x)
 # print(cl)
  out <- NextMethod("[",x) # will go to [.stranger
  class(out) <- cl
  attr(out,"meta") <- attr(x,"meta")
  return(out)
}


"[.stranger" <-function (x,...)
  {
  cl <- class(x)
  class(x) <- class(x)[!class(x) %in% c("singular","stranger")]
  out <- NextMethod("[",x) # will go to [.data.table
  class(out) <- cl
  attr(out,"meta") <- attr(x,"meta")
  return(out)
}


"[<-.singular" <-function (x,i,j,value)
{
  cl <- class(x)
  # print(cl)
  out <- NextMethod("[<-",x) # will go to [<-.stranger
  class(out) <- cl
  attr(out,"meta") <- attr(x,"meta")
  return(out)
}


"[<-.stranger" <-function (x,i,j,value)
{
  cl <- class(x)
  class(x) <- class(x)[!class(x) %in% c("singular","stranger")]
  out <- NextMethod("[<-",x) # will go to [<-.data.table
  class(out) <- cl
  attr(out,"meta") <- attr(x,"meta")
  return(out)
}

Try the stranger package in your browser

Any scripts or data that you put into this service are public.

stranger documentation built on March 18, 2018, 2:01 p.m.