[RS-ecology] Unsupervised Classification example

Benjamin Leutner benjamin.leutner at uni-wuerzburg.de
Thu Sep 8 20:14:12 CEST 2016


Hi,

there's a bug in the NA handling in unsuperClass. It is already fixed 
(current version on GitHub), but not yet released on CRAN (soon...).

In the meantime, you can either install the GitHub version of RStoolbox 
or simply fix the NA value yourself:

NAvalue(p224r63_2011_uc$map) <- -99


For the model: The loadings() is somewhat out of place here, it belongs 
to PCA.
To get the k-means model, this is enough:

p224r63_2011_uc$model


Cheers,
Benjamin


On 07.09.2016 23:01, Natalia Quinteros wrote:
> Hi all,
>
> I'm going through the book and I'm at Chapter 8 doing the Unsupervised 
> Classification example and I am obtaining a monochromatic image and a 
> Null model. I wonder if anybody have had the same problem and could 
> fix it.
>
> This is my code:
>
> set.seed(6)
> p224r63_2011 <- brick("p224r63_2011.grd", package="raster")
> p224r63_2011_uc <- unsuperClass(p224r63_2011, nSamples = 10000, 
> nClasses = 4, nStarts = 50, norm = TRUE)
> loadings(p224r63_2011_uc$model)
> colors <- rainbow(5)
> plot(p224r63_2011_uc$map)
>
> Thank you
>
> Natalia
>
> p.s. this is the image after plotting
>
> Inline image 1
>
>
> _______________________________________________
> RS-ecology mailing list
> RS-ecology at lists.uni-wuerzburg.de
> https://lists.uni-wuerzburg.de/mailman/listinfo/rs-ecology

-- 
Benjamin Leutner M.Sc.
PhD candidate

Department of Remote Sensing
University of Wuerzburg
Campus Hubland Nord 86
97074 Wuerzburg, Germany

Tel: +49-(0)931-31 89594
Fax: +49-(0)931-31 89594-0
Email: benjamin.leutner at uni-wuerzburg.de
Web: http://www.fernerkundung.uni-wuerzburg.de

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.uni-wuerzburg.de/pipermail/rs-ecology/attachments/20160908/71cdef1a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 14634 bytes
Desc: not available
URL: <http://lists.uni-wuerzburg.de/pipermail/rs-ecology/attachments/20160908/71cdef1a/attachment.png>


More information about the RS-ecology mailing list