[RS-ecology] FW: Chapter 11

Benjamin Leutner benjamin.leutner at uni-wuerzburg.de
Fri Apr 7 10:44:42 CEST 2017


dir.create() does not create nested folders by default. set "recursive = 
TRUE" to do so.

On 04/06/2017 02:05 PM, Vladimir Ruslan Wingate wrote:
> Hi all,
>> Thank you very much for you reply.
>>
>> I attached a some code for the first section of chapter 11.
>>
>> Basically I have two problems, the first is really the working
>> directory, and the second has to do with assigning dates (please see
>> below)
>>
>> Best regards,
>>
>> Vladimir
>>
>> 1)
>>
>> if (!file.exists(fileout)) {
>>
>>    if (!file.exists(pth)) {
>>
>>      print("the outfolder does not exist and will be created")
>>
>>      print(pth)
>>
>>      dir.create(pth)
>>
>>    }
>>
>> }
>>
>> [1] "the outfolder does not exist and will be created"
>>
>> [1] "C:/MODIS/raster_data/MOD13Q1"
>>
>> Warning message:
>>
>> In dir.create(pth) :
>>
>>    cannot create dir 'C:\MODIS\raster_data\MOD13Q1', reason 'No such
>> file or directory'
>>
>> 2)
>>
>> names(s) <- as.Date(modis.hdf[[1]], "A%Y%j")
>>
>> Error in `names<-`(`*tmp*`, value = c(NA_real_, NA_real_)) :
>>
>>    incorrect number of layer names
>>
> _______________________________________________
> RS-ecology mailing list
> RS-ecology at lists.uni-wuerzburg.de
> https://lists.uni-wuerzburg.de/mailman/listinfo/rs-ecology
>



More information about the RS-ecology mailing list