I have 1 dataset of animals sighted walking a survey, and I would like to tag them to the respective sampling points along a transect.
Any idea what function/package in R can do that? Maybe something nearest neighbour related?
Welcome to GIS SE! If I'm understanding your question correctly, you hope to get the distances between a set of points which represent animal sightings and another set of points which are sampling locations along a transect.
I'm not overly familiar with R, but it looks like the FNN package's get.knnx function might be of use to you. Take a look at this answer: Is there an R equivalent of NEAR in ESRI ArcGIS?
I'm not sure you have access to ArcGIS and an advanced license, but you could use the Near tool which provides distances from one set of points to another set of points.
Hope that helps,