BiologicalRecordsCentre / BRCindicators

An R package for creating indicators from trends data
4 stars 11 forks source link

error in lambda_indicator #82

Closed FrancescaMancini closed 3 months ago

FrancescaMancini commented 1 year ago

BRCindicators:::getData was masked by nlme::getData so that was returning this error

Error in getData(input = input, sample_size = sample_size, region = region) : unused arguments (input = input, sample_size = sample_size, region = region)

Once that was fixed, I got the original error from BRCindicators:::remove_bad_species

Error in Occ[, , j] * reliable : non-numeric argument to binary operator

This is the lines that causes it

OccRel <- sapply(1:dim(Occ)[3], function(j) Occ[, , j] * reliable, simplify = "array")

Turns out that all elements of Occ are character vectors.

AugustT commented 1 year ago

non-numeric argument to binary operator This seems to be happening in a couple of places since the most recent version of R. Some core behaviour has changed that we need to pin down. Error in MSI too

DylanCarbone commented 3 months ago

Hi @FrancescaMancini,

Is there a way you could replicate this error? remove_bad_species is nested inside lambda_indicator, and I've ran lambda_indicator's example code and example in the vignette and I haven't received any errors.

Thanks

AugustT commented 3 months ago

@DylanCarbone this may have been fixed already in another pull request? I suggest that is you are unable to replicate the issue you now, you close the issue