Revision 9ed6d6be90c4a866357a121a3f106a0bea1cdb99 authored by Adrian Baddeley on 22 July 2008, 00:00:00 UTC, committed by Gabor Csardi on 22 July 2008, 00:00:00 UTC
1 parent f919f46
Raw File
rlabel.R
#
#   rlabel.R
#
#   random (re)labelling
#
#   $Revision: 1.2 $   $Date: 2006/10/10 04:22:48 $
#
#
rlabel <- function(X, labels=marks(X), permute=TRUE) {
  verifyclass(X, "ppp")
  if(is.null(labels))
    stop("labels not given and marks not present")
  Y <- X %mark% sample(labels, X$n, replace=!permute)
  return(Y)
}

back to top