Yes, that works. curiously, I tried that initially but it did not work because of the "" around x. Thank you very much for your help ________________________________________
for future readers inhull can be used with apply using: library (alphahull) DT=data.frame(x=c(0.25,0.25,0.75,0.75),y=c(0.25,0.75,0.75,0.25)) Hull <- ahull(DT, alpha = 0.5) TEST<- data.frame(x=c(0.25,0.5),y=c(0.5,0.5)) sd<-apply(TEST, 1, function(x) inahull(Hull, x)) ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.