Recently an update became available for spatialEco, an argument poly.id was added, allowing you to work NA's (after this discussion). For some reason the attributes from the polygons are no longer added tot the point shapefile, only the column name specified under poly.id somehow is added.

Am I missing something in the new update that still transfers ALL attributes from the shapefile?



1 Answer 1


When I retooled the function, I meant to add an argument for merging the polygon attributes and honestly just forgot. I am just getting ready to release a new version of the package and will add this option to the function. Should be up on CRAN in a few days. In the meantime you can just use the merge() function to add the polygon attributes based on the polygon ID or rownames.

**** Edit 02/08/2018 **** I just rewrote the function so that the attributes are returned and the function now also accounts for multiple intersecting polygons. There is now an argument "duplicate" that controls the behavior of intersecting multiple polygons. In this case, either a duplicate point is created for each polygon intersection or new columns are created containing the IDS of each intersecting polygon. So, it a given point intersects three separate polygons then that point is represented three times in the data, each with the associated polygons attributes or has three new columns. This should be up on CRAN in a few days but in the meantime you can grab the function on the packages GitHub development site.

You can install the GitHub development version using:

  • Great! Looking forward to use it :)
    – Jobbo90
    Commented Feb 12, 2018 at 15:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.