r-spatialecology/landscapemetrics

calculate_lsm not working

Closed this issue · 9 comments

Hello,
the function calculate_lsm is currently producing an error:

Error in list_lsm(level = level, metric = metric, name = name, type = type,  : 
  object 'lsm_abbreviations_names' not found

the code:

landscapemetrics::calculate_lsm(landscape=landscapemetrics::augusta_nlcd, level = c("class", "landscape"), type = "aggregation metric")

Could you please share your sessionInfo() with me. On my computer, your code is working and I can't reproduce your error.

landscapemetrics::calculate_lsm(landscape=landscapemetrics::augusta_nlcd, level = c("class", "landscape"), type = "aggregation metric")
Error in list_lsm(level = level, metric = metric, name = name, type = type, :
object 'lsm_abbreviations_names' not found
sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] compiler_3.4.1 assertthat_0.2.0 cli_1.1.0
[4] pillar_1.3.1 sp_1.2-7 tibble_2.0.1
[7] crayon_1.3.4 Rcpp_1.0.3 raster_2.8-19
[10] codetools_0.2-15 grid_3.4.1 pkgconfig_2.0.2
[13] rlang_0.4.0 landscapemetrics_1.1 lattice_0.20-35

Could you please update the landscapemetrics package (current CRAN version is v1.4.3) and see if you still get the same error?

image
it automatically installs the binary v.1.1

@gazzapol you need to update your R version first. The current R is 3.6.3 and you have R 3.4.1, which is almost three years old.

@mhesselbarth source v. 1.4.3 do not produce the error (which binary v.1.1 actually does). @Nowosad the installed R version is not the problem here (I have not updated the R version meanwhile). Maybe is a bug in the 1.1 version? Still, R atutomatically installs the 1.1 version, unless "source" is specified.

image

@gazzapol It is possible that there was a bug in the 1.1 version. However the bug was fixed and does not exist in 1.4.3.

The installed R version is a problem here - binaries version changes with R versions. Therefore, with R 3.6.3 you will also have the binary version of landscapemetrics 1.4.3.

@Nowosad Oh I did not know that, thanks for the hint.

👍