[R] "inahull? from package alphahull not working when used with lapply
Camilo Mora
cmora at Dal.Ca
Mon Oct 27 22:41:05 CET 2014
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))
More information about the R-help
mailing list