Skip to content
Prev 26946 / 29559 Next

Random forest script - problems with training areas polygon?

Hi all,



I have been working with the random forest R script and have had no
problems at all up to now.

I recently modified the training areas shapefile. It?s actually an edited
version of the original shapefile (which worked just fine). Same
projection, etc, only the areas are smaller and more specific. That's the
only input I changes. The script reads the shapefile but it doesn't do the
classification.



The error  I get is:

 Error in `[.data.frame`(satValues, , 2) : undefined columns selected



Checking line by line, he problem seems to be (line 139 of the loop):

satValues <- extract(satImage, class_data[i,], cellnumbers=TRUE, df=TRUE)





I?m not very skilled at using R but I?m quite OK with GIS. I have tried
editing the shapefile again, saving it as another file, etc. Same result.



Any ideas what could be going wrong?

Thanks!



Silvia


<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Libre
de virus. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#m_542342069031620777_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>