# NOT RUN {
data("calves")
water_trough.x<- c(61.43315, 61.89377, 62.37518, 61.82622) #water polygon x-coordinates
water_trough.y<- c(62.44815, 62.73341, 61.93864, 61.67411) #water polygon y-coordinates
headWater1<- confine(calves, point.x = calves$x, point.y = calves$y,
confinementCoord.x = water_trough.x, confinementCoord.y = water_trough.y,
filterOutput = TRUE) #creates a data set comprised ONLY of points within the water polygon.
headWater2<- confine(calves, point.x = calves$x, point.y = calves$y,
confinementCoord.x = water_trough.x, confinementCoord.y = water_trough.y,
filterOutput = FALSE) #appends the "confinement_status" column to x.
# }
Run the code above in your browser using DataLab