Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a focused error message for bandnames with leading numbers #50

Merged
merged 4 commits into from
Jan 3, 2023

Conversation

gisma
Copy link
Contributor

@gisma gisma commented Jan 2, 2023

Since terra allows the layers in a stack to begin with a number, it will be automatically converted to an raster stack via newdata <- methods::as(newdata, "Raster") s. Due to the raster conventions this is done by adding a leading "X" to the layer name. Normally, however, model training and DI calculation have been carried out on the terra-stack without this leading "X".

The pull request checks whether the layer names have a leading number as name and points this out in the error message.
Maybe this helps to avoid confusion about the message "names of newdata don't match names of train data in the model" which is thrown by default.

@HannaMeyer HannaMeyer merged commit d7d393e into HannaMeyer:master Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants