<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi, <br>
    <br>
    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...).<br>
    <br>
    In the meantime, you can either install the GitHub version of
    RStoolbox or simply fix the NA value yourself:<br>
    <br>
    <pre>NAvalue(p224r63_2011_uc$map) <- -99</pre>
    <br>
    For the model: The loadings() is somewhat out of place here, it
    belongs to PCA.<br>
    To get the k-means model, this is enough:<br>
    <br>
    <pre>p224r63_2011_uc$model </pre>
    <br>
    Cheers,<br>
    Benjamin<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 07.09.2016 23:01, Natalia Quinteros
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAOZBhq3EjDko91hyfSXoyGrZZsHdZAWRBpnUCYQXcboFEndGpg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>Hi all, </div>
        <div><br>
        </div>
        <div>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. </div>
        <div><br>
        </div>
        <div>This is my code: </div>
        <div><br>
        </div>
        <div>set.seed(6)<br>
          p224r63_2011 <- brick("p224r63_2011.grd", package="raster")<br>
          p224r63_2011_uc <- unsuperClass(p224r63_2011, nSamples =
          10000, nClasses = 4, nStarts = 50, norm = TRUE)<br>
          loadings(p224r63_2011_uc$model)<br>
          colors <- rainbow(5)<br>
          plot(p224r63_2011_uc$map)</div>
        <div><br>
        </div>
        <div>Thank you</div>
        <div><br>
        </div>
        <div>Natalia</div>
        <div><br>
        </div>
        <div>p.s. this is the image after plotting </div>
        <div><br>
        </div>
        <div><img alt="Inline image 1"
            src="cid:part1.926357EC.8360A012@uni-wuerzburg.de"
            height="395" width="416"></div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
RS-ecology mailing list
<a class="moz-txt-link-abbreviated" href="mailto:RS-ecology@lists.uni-wuerzburg.de">RS-ecology@lists.uni-wuerzburg.de</a>
<a class="moz-txt-link-freetext" href="https://lists.uni-wuerzburg.de/mailman/listinfo/rs-ecology">https://lists.uni-wuerzburg.de/mailman/listinfo/rs-ecology</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
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: <a class="moz-txt-link-abbreviated" href="mailto:benjamin.leutner@uni-wuerzburg.de">benjamin.leutner@uni-wuerzburg.de</a>
Web: <a class="moz-txt-link-freetext" href="http://www.fernerkundung.uni-wuerzburg.de">http://www.fernerkundung.uni-wuerzburg.de</a>
</pre>
  </body>
</html>