R/pinhull.r

Defines functions Pinhull

Documented in Pinhull

Pinhull <- function(pts, ppts) {
ncol <- length(ppts)
out <- matrix(FALSE, ncol=ncol, nrow=nrow(pts))
colnames (out) <- names(ppts)
events <- data.frame(EID=1:nrow(pts), X=pts[, 1], Y=pts[, 2])
for (i in seq_len(ncol)) {
 ppol <- data.frame(ppts[[i]], PID=i, POS=seq_len(nrow(ppts[[i]])))
 names(ppol)[1:2] <- c("X", "Y")
 eids <- PBSmapping::findPolys(events, ppol)$EID
 out[eids, i] <- TRUE
 }
out
}

Try the shipunov package in your browser

Any scripts or data that you put into this service are public.

shipunov documentation built on Feb. 16, 2023, 9:05 p.m.