r-spatialecology/landscapemetrics

get_adjacencies

Closed this issue · 3 comments

A couple of points on the get_adjacencies function that I think need clarifying / improving:

  1. upper = TRUE only has an effect (and only makes sense) for unlike. What is the reasoning for having this parameter?

  2. Full explanation of the output would be useful.

  3. The second parameter will take in some nonsensical parameters. For example, a single number can be provided as input, but it doesn't make sense to do so. I'll see if I can add in a meaningful check to this (e.g. check input is 4, 8 or logical matrix).

I will look at this on Monday

Hey @laurajanegraham,

  1. You find the same pattern in base::diag(), so we thought that there is maybe someone that has a workflow which relies on the upper diagonal 🤷‍♂️

  2. I made it a bit more verbose, is it fine like this?

  3. Fixed, now throws a warning if the input is neither 4, 8 or a matrix.

Hi @marcosci, all looks good to me.