jbferet / prosail

R package dedicated to the PROSAIL canopy reflectance model. The package allows running PROSAIL in direct and inverse modes, with various inversion strategies. A tutorial can be found on the gitlab website
https://jbferet.gitlab.io/prosail/
GNU General Public License v3.0
16 stars 2 forks source link

Dplyr slice error with new version v5.2.2 and tutorial for hybrid model inversion #3

Open katjakowalski opened 1 week ago

katjakowalski commented 1 week ago

Hello, I'm getting an error when running the online tutorial for hybrid model inversion (https://jbferet.gitlab.io/prosail/articles/prosail3.html) using the 'train_prosail_inversion' and the 'PROSAIL_Hybrid_Train' functions with the current prosail version. The error seems to be related to the 'dplyr slice' function, which I noticed was added to the newest version. The first function progresses to 100% and generates two text files as expected. The specific error message I'm seeing is: 'Error in UseMethod("slice") : no applicable method for 'slice' applied to an object of class "c('matrix', 'array', 'double', 'numeric')"'.

Do you have any idea how this could be fixed? Thanks for your help! Katja

jbferet commented 1 week ago

hello @katjakowalski , thank you for reporting this error. Indeed, this appeared when pushing the version 2.5.2 to correct another problem. The latest version, v2.5.3 now fixes the problem, so you should be able to run the tutorial now. Please let me know if additional problems occur.

PS: the package preprocS2 used in the next tutorial was also updated today, so you may want to update it when getting to tutorial #4