Error message trying to read shapefile using sf package


I have a piece of code I've been using to read an sf object that has always worked perfectly well. Now, however, I'm getting an error message:

Error in CPL_get_z_range(obj, 3) : z error - expecting three columns;

The shapefile hasn't changed and neither has the code, which I've pasted below.


shp <- read_sf(dsn = ".", layer = "NCCA_GL_2020_Frame_4_14_21") %>%

Has something changed in the sf package? Has anyone else had this issue?

Thanks so much!

Hello @HABSaremyjam ,

I cant say much without playing around the shape file. However, I did find an issue that may help you. Please take a look at the github discussion here.

The complete issue thread on the {sf} repo is here,

Hope this works,

1 Like

Thank you so much! That worked. Not sure how you found that - I looked through what I felt was countless forums. Thanks again!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.