[RS-ecology] RS-ecology Digest, Vol 16, Issue 1

Dragan Kaludjerovic advancedgwt at gmail.com
Mon Dec 12 15:45:18 CET 2016


Martin,
I have replaced brick() with stack() and still got the error when I run the
line data. Here is how it looks now:

install.packages("RStoolbox")
install.packages(raster)

library(ggplot2)
library(raster)
library(rgdal)

bs3 <- raster("C:/R_examples/VI/B3.TIF")
bs4 <- raster("C:/R_examples/VI/B4.TIF")

bs3
bs4

group <- stack(bs3, bs4)

#writeRaster(group, filename = "C:/R_examples/VI/grupa.TIF")

data(group)

## Calculate NDVI

ndvi <- spectralIndices(group, red = "bs3", nir = "bs4", indices = "NDVI")

ndvi

eror when I run line data(group)

Warning message:In data(group) : data set ‘group’ not found


On Mon, Dec 12, 2016 at 8:17 AM, Martin Wegmann <
martin.wegmann at uni-wuerzburg.de> wrote:

> Dear Dragan,
>
> Please replace brick() with stack() and it should work, and of course you
> need to adapt your band names in spectralIndices()‎.
>
> Regards, Martin
>
> *From: *Dragan Kaludjerovic
> *Sent: *Sunday, December 11, 2016 23:21
> *To: *rs-ecology at lists.uni-wuerzburg.de
> *Subject: *Re: [RS-ecology] RS-ecology Digest, Vol 16, Issue 1
>
> Now I have changed it, but still getting error
>
> install.packages("RStoolbox")
> install.packages(raster)
>
> library(ggplot2)
> library(raster)
> library(rgdal)
>
> bs3 <- raster("C:/R_examples/VI/B3.TIF")
> bs4 <- raster("C:/R_examples/VI/B4.TIF")
>
> bs3
> bs4
>
> group <- brick(bs3, bs4)
>
> data(group)
>
> ## Calculate NDVI
>
> ndvi <- spectralIndices(group, red = "bs3", nir = "bs4", indices = "NDVI")
>
> ndvi
>
> error is:
>
>
> > group <- brick(bs3, bs4)> data(group)Warning message:In data(group) : data set ‘group’ not found
>
>
> On Sun, Dec 11, 2016 at 12:00 PM, <rs-ecology-request at lists.uni-
> wuerzburg.de> wrote:
>
>> Send RS-ecology mailing list submissions to
>>         rs-ecology at lists.uni-wuerzburg.de
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>>         https://lists.uni-wuerzburg.de/mailman/listinfo/rs-ecology
>> or, via email, send a message with subject or body 'help' to
>>         rs-ecology-request at lists.uni-wuerzburg.de
>>
>> You can reach the person managing the list at
>>         rs-ecology-owner at lists.uni-wuerzburg.de
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of RS-ecology digest..."
>>
>>
>> Today's Topics:
>>
>>    1. problem with RStoolbox (Dragan Kaludjerovic)
>>    2. Re: problem with RStoolbox (Martin Wegmann)
>>
>>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Sat, 10 Dec 2016 19:00:11 +0100
>> From: Dragan Kaludjerovic <advancedgwt at gmail.com>
>> To: RS-ecology at lists.uni-wuerzburg.de
>> Subject: [RS-ecology] problem with RStoolbox
>> Message-ID:
>>         <CAFZvhLipaCHuq-hQsk_5i31ThbCXGQZ4cPhP87+YS4P6__rzDw at mail.
>> gmail.com>
>> Content-Type: text/plain; charset="utf-8"
>>
>> Hi,
>> I have just discover RStoolbox and try simple simple script
>>
>> install.packages("RStoolbox")
>> install.packages(raster)
>>
>> library(ggplot2)
>> library(raster)
>> library(rgdal)
>>
>> data(img)
>>
>> ## Calculate NDVI
>> ndvi <- spectralIndices(img, red = "C:/R_examples/VI/B3.tif", nir =
>> "C:/R_examples/VI/B4.tif", indices = "NDVI")
>> ndvi
>>
>>
>> when I run it I got error message
>>
>> Error in match(xi, names(img)) : object 'img' not found
>>
>> Any suggestion is welcomed!
>>
>> Best Regards,
>>
>> Dragan
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL: <http://lists.uni-wuerzburg.de/pipermail/rs-ecology/attachme
>> nts/20161210/0a7d11e2/attachment-0001.html>
>>
>> ------------------------------
>>
>> Message: 2
>> Date: Sun, 11 Dec 2016 09:46:02 +0100
>> From: Martin Wegmann <martin.wegmann at uni-wuerzburg.de>
>> To: Dragan Kaludjerovic <advancedgwt at gmail.com>,
>>         RS-ecology at lists.uni-wuerzburg.de
>> Subject: Re: [RS-ecology] problem with RStoolbox
>> Message-ID: <20161211084602.5943378.73264.3393 at uni-wuerzburg.de>
>> Content-Type: text/plain; charset="us-ascii"
>>
>> An HTML attachment was scrubbed...
>> URL: <http://lists.uni-wuerzburg.de/pipermail/rs-ecology/attachme
>> nts/20161211/c04e82de/attachment-0001.html>
>>
>> ------------------------------
>>
>> _______________________________________________
>> RS-ecology mailing list
>> RS-ecology at lists.uni-wuerzburg.de
>> https://lists.uni-wuerzburg.de/mailman/listinfo/rs-ecology
>>
>>
>> End of RS-ecology Digest, Vol 16, Issue 1
>> *****************************************
>>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.uni-wuerzburg.de/pipermail/rs-ecology/attachments/20161212/55566bb3/attachment.html>


More information about the RS-ecology mailing list