0

I am using a library (sparr), which relies on spatstat. After executing a function from sparr, namely LSCV.risk() I am getting the following error:

Internal error: 1498 pixel values were NA, even after projection

I was able to track it down to here https://rdrr.io/github/spatstat/spatstat.geom/src/R/images.R But I have not idea what this error is trying to tell me. Is someone able to "translate" this for me or can guess, whats going on/which function is failing? For what it's worth, the data I am working with is projected in UTM.

four-eyes
  • 10,740
  • 29
  • 111
  • 220
  • 1
    It's easier to help you if you provide a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input that can be used to test and verify possible solutions. – MrFlick May 04 '22 at 14:30
  • @MrFlick I cannot, the data I am working with is sensitve. And since I think this is a problem with my inputdata, I want to know, what this error is trying to tell me, so that I can check on my input data... Because from looking at the source code, I cannot tell... – four-eyes May 04 '22 at 14:39
  • Unfortunately there's not a 1:1 correspondence between error message and actual problem. Usually it's only possible to really understand the error when you have a reproducible example that you can step through and debug. You'd have to know why this function is being called and what is expected for your particular use case. – MrFlick May 04 '22 at 14:44
  • @MrFlick I know that, but sometimes there is someone out here, who can tell by experience or by having had the same problem, what might be the cause. – four-eyes May 04 '22 at 15:01
  • Please provide the R traceback output. (Re-run the code that generates the error, then type `traceback()`, and copy the output. ) This will tell us where the error is occurring. – Adrian Baddeley May 05 '22 at 04:44
  • 1
    The error message comes from code that looks up the pixel value of an image at a location specified by spatial coordinates. An NA value is returned if the query location lies outside the spatial region where the pixel image is defined. So the most likely cause of the error is a mismatch between your spatial point coordinates and your pixel image coordinates. Did you apply the same geographical coordinate transformation to both sets of data? – Adrian Baddeley May 05 '22 at 04:52

0 Answers0