R/subset.r

setGeneric("[")
setMethod("[", 
		signature(x="MoveBB"),
		definition=function(x,i,j,...) {
	if(!missing(i)) {
		x@variance <- x@variance[i]
	} else { i<-T }
	if (missing(j)) { j<-T }
	
	callNextMethod(x=x,i=i,j=j,...)
})

setMethod("[", 
		signature(x="MoveBBStack"),
		definition=function(x,i,j,...) {
	if(!missing(i)) {
		x@variance <- x@variance[i]
		x@diffusion <- x@diffusion[unique(x@trackId[i])]
	} else { i<-T }
	if (missing(j)) { j<-T }
	callNextMethod(x=x,i=i,j=j,...)
})

setMethod("[[",
		signature(x="UDStack"),
		definition=function(x, i) {
	u <- callNextMethod()
	new("UD", u)
})

Try the moveBB package in your browser

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

moveBB documentation built on May 2, 2019, 5:50 p.m.