1

I've been working with raster data and the code has been working fine. Unexpectedly when reprojecting with:

reproject()  

I get

"Error in wkt(projfrom) :could not find function "wkt".

I'm using CRS arguments:

 +proj=utm +zone=5 +datum=WGS84 +units=m +no_defs  

I have also tried projectRaster() and get a similar error.

Might be an issue with the rgdal package? Anyone else getting this?

M--
  • 25,431
  • 8
  • 61
  • 93
hec317
  • 11
  • 3

1 Answers1

1

This problem should go away if you update the sp package

Robert Hijmans
  • 40,301
  • 4
  • 55
  • 63
  • Well, I use R 4.0.4, and just updated packages raster, sp, rgdal, dismo, rJava, rgeos, and maptools. Still getting a message 'Error in wkt(r) : could not find function "wkt" '. Any idea why it could happen? Thanks. – Lybica Mar 11 '21 at 23:11
  • Do the examples in `?projectRaster` work for you? They work fine for me with R and current packages. – Robert Hijmans Mar 11 '21 at 23:39
  • No, unfortunately they don't. > ?projectRaster Warning message: no function found corresponding to methods exports from ‘raster’ for: ‘wkt’ > wkt(r) Error in wkt(r) : could not find function "wkt" – Lybica Mar 11 '21 at 23:41
  • Then suggest that you are not using current R. Can you report the first three lines returned by `sessionInfo()`; and confirm that further down it prints `raster_3.4-5 sp_1.4-5 `? – Robert Hijmans Mar 12 '21 at 00:01
  • Your comment prompted me to restart my computer and install sp again. And everything works now! Thank you so much for your time and sorry i didn't do it earlier - my R version was showing as 4.0.4. immediately after I reinstalled R. – Lybica Mar 12 '21 at 00:19