[R-sig-Geo] Random forest script - problems with training areas polygon?

Roman Luštrik rom@n@lu@trik @ending from gm@il@com
Wed Nov 7 15:03:02 CET 2018


Can you make a reproducible example (data, scripts)? Have you tried
debugging your code?

Cheers,
Roman

On Wed, Nov 7, 2018 at 2:36 PM Silvia Flaherty <silvia.flaherty using gmail.com>
wrote:

> 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>
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>


-- 
In God we trust, all others bring data.

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list