I am trying to reproject a shapefile. For example, the land shapefile from Natural Earth.

shape <- read_sf(".../ne_10m_land.shp")

shape_proj<-spTransform(shape, CRS("+proj=gnom +lat_0=90 +lon_0=-50"))

I keep getting the following error, even when I try with CRSobj= or using other ways to express the CRS.

Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘spTransform’ for signature ‘"sf", "CRS"’

  • 2
    You're mixing two generations of vector features packages. spTranform is for sp objects (the 'old' way). For sf objects you must use st_transform – Loïc Dutrieux Jan 2 at 22:36
  • AH. That did it. Many thanks. – webbe Jan 3 at 1:57

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.