r-spatialecology/landscapemetrics

Check class of landscape

Closed this issue · 7 comments

I got the following mail:

[...]
Apparently your package no longer works correctly when
class(matrix(...)) gives a vector of length two and conditions of length
greater than one in 'if' or 'while' give an error: please fix as
necessary.

See
https://developer.r-project.org/Blog/public/2019/11/09/when-you-think-class.-think-again/index.html
for more information about correctly using class() in package code.

Please correct before 2019-12-18 to safely retain your package on CRAN.
[...]

I will push in a few minutes

We probably should use !inherits(landscape, "matrix")

I went for !is(landscape, "matrix") which should be the same.

I'm just running some checks at the moment if everything runs smoothly.

Fixed: 3dcc29c

Okay....I had some problems with my local git and needed to rebase.

Should be fixed now: 2ad24f8, 6c0cb8a