rotmean(X, ..., origin, padzero=TRUE, Xname, result=c("fv", "im"))shift.owin.
  TRUE (the default), the value of X
    is assumed to be zero outside the window of X.
    If FALSE, the value of X is taken to be undefined
    outside the window of X.
  X to be used in the
    function labels.
  "fv" or "im".
  If result="fv" (the default) the result is a function
  object of class "fv" giving the mean pixel value of X
  as a function of distance from the origin.
  If result="im" the result is a pixel image, with the same
  dimensions as X, giving the mean value of X
  over all pixels lying at the same distance from the origin
  as the current pixel.
  If padzero=TRUE (the default), the value of X
  is assumed to be zero outside the window of X. The rotational
  mean at a given distance $r$ is the average value of the image
  X over the entire circle of radius $r$,
  including zero values outside the window if the circle
  lies partly outside the window.
  
  If padzero=FALSE, the value of X is taken to be
  undefined outside the window of X. The rotational mean
  is the average of the X values over the subset of the circle
  of radius $r$ that lies entirely inside the window.
  if(interactive()) {
    Z <- setcov(square(1))
    plot(rotmean(Z))
    plot(rotmean(Z, result="im"))
  } else {
    Z <- setcov(square(1), dimyx=32)
    f <- rotmean(Z)
  }
Run the code above in your browser using DataLab