[RS-ecology] Inquiry (Importing Landsatdata into R_

Benjamin Leutner benjamin.leutner at uni-wuerzburg.de
Tue Dec 12 14:29:41 CET 2017


In the future please also report the error message.

just from looking at you filepaths I bet that your path
"D:/PROJECTS/PhD_Projects/Objective_1/Classification_in_R/1985/raster_data/LT51930551985065XXX01/" 

is incorrect/does not exist or does not contain any files with names 
matching "TIF"

If you look at "allBands" it will probably say
character(0)

which means it didn't find any files.




On 12/11/2017 02:13 PM, Séna Koglo wrote:
> Hi everyone,
>
> I trying to import my Landsat data into R using the command provided 
> in the book but it fails. Could someone help me through? below is the 
> commands that I used :
>
> library(raster)
> library(sp)
>
> setwd('D:/PROJECTS/PhD_Projects/Objective_1/Classification_in_R/1985') 
> # working directory containing landsat files
>
> allBands<-list.files("raster_data/LT51930551985065XXX01/", pattern = 
> "TIF",
>              full.names = TRUE)   # Command to import all bands
>
> p193_r055_1985<- stack(allBands) # Command to stack the band
>
> Looking forwards in hearing from you.
>
> Regards,
>
>
> --------------------------------
> *Yawovi Séna KOGLO*
> *Agronomist Engineer (Crop & Soil Science)*
> *WASCAL PhD Student CC & LU, KNUST, Ghana*
> *Skype: koyasega1*
> *Contact: +233245363101 or +233501589453 (Ghana)*
> *               +22891315854 (Togo)
> ***
>
>
>
> _______________________________________________
> RS-ecology mailing list
> RS-ecology at lists.uni-wuerzburg.de
> https://lists.uni-wuerzburg.de/mailman/listinfo/rs-ecology

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.uni-wuerzburg.de/pipermail/rs-ecology/attachments/20171212/be934eab/attachment.html>


More information about the RS-ecology mailing list