R/burstId.R

setGeneric("burstId", function(x) {
  standardGeneric("burstId")
})
setMethod("burstId",
  signature = ".MoveTrackSingleBurst",
  definition = function(x) {
    return(slot(x, "burstId"))
  }
)
setGeneric("burstId<-", function(x, value) standardGeneric("burstId<-"))
setReplaceMethod(
  "burstId", c(".MoveTrackSingleBurst", "factor"),
  function(x, value) {
    if (n.locs(x) != (length(value) + 1)) {
      stop("A new burst id does not have the same length as the orginal object")
    }
    x@burstId <- value
    x
  }
)
setReplaceMethod(
  "burstId", c(".MoveTrackSingleBurst", "character"),
  function(x, value) {
    value <- as.factor(value)
    callGeneric()
  }
)

Try the move package in your browser

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

move documentation built on July 9, 2023, 6:09 p.m.