When reaching the last class, the user obtains class NA
In the last step of a classification we need to add a pseudo class. The reference data for the pseudo class is build with the following code:
if (last == T) {
reference <- rbind(reference, rep(3000, ncol(reference)))
}
With an hard coded value it is not possible to change it which can lead to the selection of the pseudo class leading to a NA
as selected class.