Dear List,

This is likely a silly question, but I am just beginning to learn how to
incorporate loops into my functions.  I have written a function that allows
me to perform a series of steps that I need to do:

function.x <- function(x, y, window, b.size, k.keep){
  ppp <- ppp(x, y, window=window)
  k <- density(ppp, b.size, edge=TRUE, at="pixel", diggle=TRUE,
window=window)
  df <- data.frame(k)
  k.extract <- df[df$value >= (k.keep*max(df$value)), ]
  extract.ppp <- ppp(k.extract$x, k.extract$y, window=window)
  shape <- convexhull(extract.ppp)
}

As of now, I must subset the my data first into months and then run the
function for each month separately.  I have been trying all morning to
insert a loop that can subset my data into months for me, run the function,
and then return the convexhulls as objects that I can save as polygons.

I would deeply appreciate any help.

Thanks,

Bryce

	[[alternative HTML version deleted]]

