<html><head></head><body lang="en-GB" style="background-color: rgb(255, 255, 255); line-height: initial;">                                                                                      <div style="width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif, sans-serif; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);">Dear Dragan,</div><div style="width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif, sans-serif; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);"><br></div><div style="width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif, sans-serif; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);">Please replace brick() with stack() and it should work, and of course you need to adapt your band names in spectralIndices()‎.</div><div style="width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif, sans-serif; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);"><br></div><div style="width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif, sans-serif; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);">Regards, Martin</div>                                                                                                                                     <div style="width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif, sans-serif; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);"><br style="display:initial"></div>                                                                                                                                                                                                   <div style="font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif, sans-serif; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);"></div>                                                                                                                                                                                  <table width="100%" style="background-color:white;border-spacing:0px;"> <tbody><tr><td colspan="2" style="font-size: initial; text-align: initial; background-color: rgb(255, 255, 255);">                           <div style="border-style: solid none none; border-top-color: rgb(181, 196, 223); border-top-width: 1pt; padding: 3pt 0in 0in; font-family: Tahoma, 'BB Alpha Sans', 'Slate Pro'; font-size: 10pt;">  <div><b>From: </b>Dragan Kaludjerovic</div><div><b>Sent: </b>Sunday, December 11, 2016 23:21</div><div><b>To: </b>rs-ecology@lists.uni-wuerzburg.de</div><div><b>Subject: </b>Re: [RS-ecology] RS-ecology Digest, Vol 16, Issue 1</div></div></td></tr></tbody></table><div style="border-style: solid none none; border-top-color: rgb(186, 188, 209); border-top-width: 1pt; font-size: initial; text-align: initial; background-color: rgb(255, 255, 255);"></div><br><div id="_originalContent" style=""><div dir="ltr"><div>Now I have changed it, but still getting error<br><br><span style="color:rgb(0,0,255)">install.packages("RStoolbox")<br>install.packages(raster)<br><br>library(ggplot2)<br>library(raster)<br>library(rgdal)<br><br>bs3 <- raster("C:/R_examples/VI/B3.TIF")<br>bs4 <- raster("C:/R_examples/VI/B4.TIF")<br><br>bs3<br>bs4<br><br>group <- brick(bs3, bs4)<br><br>data(group)<br><br>## Calculate NDVI <br><br>ndvi <- spectralIndices(group, red = "bs3", nir = "bs4", indices = "NDVI")<br><br>ndvi<br><br></span></div>error is:<span style="color:rgb(0,0,255)"><br><br></span><br><pre tabindex="0" class="gmail-GODMDAHBLOB" id="gmail-rstudio_console_output" style="font-family:"lucida console";font-size:10pt;outline:medium none;border-width:medium;border-style:none;border-color:-moz-use-text-color;word-break:break-all;margin:0px;white-space:pre-wrap;line-height:15px;color:rgb(0,0,0);font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-indent:0px;text-transform:none;word-spacing:0px;background-color:rgb(255,255,255)"><span class="gmail-GODMDAHBBPB gmail-ace_keyword" style="color:blue;white-space:pre">> </span><span class="gmail-GODMDAHBBOB gmail-ace_keyword" style="color:blue">group <- brick(bs3, bs4)
</span><span class="gmail-GODMDAHBBPB gmail-ace_keyword" style="color:blue;white-space:pre">> </span><span class="gmail-GODMDAHBBOB gmail-ace_keyword" style="color:blue">data(group)
</span><span class="gmail-GODMDAHBFOB gmail-ace_constant" style="color:rgb(197,6,11)">Warning message:
</span><span class="gmail-GODMDAHBFOB gmail-ace_constant" style="color:rgb(197,6,11)">In data(group) :</span><span class="gmail-GODMDAHBFOB gmail-ace_constant" style="color:rgb(197,6,11)"> data set ‘group’ not found</span></pre></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Dec 11, 2016 at 12:00 PM,  <span dir="ltr"><<a href="mailto:rs-ecology-request@lists.uni-wuerzburg.de" target="_blank">rs-ecology-request@lists.uni-wuerzburg.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send RS-ecology mailing list submissions to<br>
        <a href="mailto:rs-ecology@lists.uni-wuerzburg.de">rs-ecology@lists.uni-<wbr>wuerzburg.de</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="https://lists.uni-wuerzburg.de/mailman/listinfo/rs-ecology" rel="noreferrer" target="_blank">https://lists.uni-wuerzburg.<wbr>de/mailman/listinfo/rs-ecology</a><br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:rs-ecology-request@lists.uni-wuerzburg.de">rs-ecology-request@lists.uni-<wbr>wuerzburg.de</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:rs-ecology-owner@lists.uni-wuerzburg.de">rs-ecology-owner@lists.uni-<wbr>wuerzburg.de</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of RS-ecology digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. problem with RStoolbox (Dragan Kaludjerovic)<br>
   2. Re: problem with RStoolbox (Martin Wegmann)<br>
<br>
<br>
------------------------------<wbr>------------------------------<wbr>----------<br>
<br>
Message: 1<br>
Date: Sat, 10 Dec 2016 19:00:11 +0100<br>
From: Dragan Kaludjerovic <<a href="mailto:advancedgwt@gmail.com">advancedgwt@gmail.com</a>><br>
To: <a href="mailto:RS-ecology@lists.uni-wuerzburg.de">RS-ecology@lists.uni-<wbr>wuerzburg.de</a><br>
Subject: [RS-ecology] problem with RStoolbox<br>
Message-ID:<br>
        <<a href="mailto:CAFZvhLipaCHuq-hQsk_5i31ThbCXGQZ4cPhP87%2BYS4P6__rzDw@mail.gmail.com">CAFZvhLipaCHuq-hQsk_<wbr>5i31ThbCXGQZ4cPhP87+YS4P6__<wbr>rzDw@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hi,<br>
I have just discover RStoolbox and try simple simple script<br>
<br>
install.packages("RStoolbox")<br>
install.packages(raster)<br>
<br>
library(ggplot2)<br>
library(raster)<br>
library(rgdal)<br>
<br>
data(img)<br>
<br>
## Calculate NDVI<br>
ndvi <- spectralIndices(img, red = "C:/R_examples/VI/B3.tif", nir =<br>
"C:/R_examples/VI/B4.tif", indices = "NDVI")<br>
ndvi<br>
<br>
<br>
when I run it I got error message<br>
<br>
Error in match(xi, names(img)) : object 'img' not found<br>
<br>
Any suggestion is welcomed!<br>
<br>
Best Regards,<br>
<br>
Dragan<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.uni-wuerzburg.de/pipermail/rs-ecology/attachments/20161210/0a7d11e2/attachment-0001.html" rel="noreferrer" target="_blank">http://lists.uni-wuerzburg.<wbr>de/pipermail/rs-ecology/<wbr>attachments/20161210/0a7d11e2/<wbr>attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Sun, 11 Dec 2016 09:46:02 +0100<br>
From: Martin Wegmann <<a href="mailto:martin.wegmann@uni-wuerzburg.de">martin.wegmann@uni-wuerzburg.<wbr>de</a>><br>
To: Dragan Kaludjerovic <<a href="mailto:advancedgwt@gmail.com">advancedgwt@gmail.com</a>>,<br>
        <a href="mailto:RS-ecology@lists.uni-wuerzburg.de">RS-ecology@lists.uni-<wbr>wuerzburg.de</a><br>
Subject: Re: [RS-ecology] problem with RStoolbox<br>
Message-ID: <<a href="mailto:20161211084602.5943378.73264.3393@uni-wuerzburg.de">20161211084602.5943378.73264.<wbr>3393@uni-wuerzburg.de</a>><br>
Content-Type: text/plain; charset="us-ascii"<br>
<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.uni-wuerzburg.de/pipermail/rs-ecology/attachments/20161211/c04e82de/attachment-0001.html" rel="noreferrer" target="_blank">http://lists.uni-wuerzburg.<wbr>de/pipermail/rs-ecology/<wbr>attachments/20161211/c04e82de/<wbr>attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
______________________________<wbr>_________________<br>
RS-ecology mailing list<br>
<a href="mailto:RS-ecology@lists.uni-wuerzburg.de">RS-ecology@lists.uni-<wbr>wuerzburg.de</a><br>
<a href="https://lists.uni-wuerzburg.de/mailman/listinfo/rs-ecology" rel="noreferrer" target="_blank">https://lists.uni-wuerzburg.<wbr>de/mailman/listinfo/rs-ecology</a><br>
<br>
<br>
End of RS-ecology Digest, Vol 16, Issue 1<br>
******************************<wbr>***********<br>
</blockquote></div><br></div>
<br><!--end of _originalContent --></div></body></html>