[R-sig-Geo] [FORGED] Request for help about running a loop and reading .NC files

Rolf Turner r@turner @end|ng |rom @uck|@nd@@c@nz
Mon Mar 23 23:36:10 CET 2020


On 24/03/20 10:52 am, Bhaskar Mitra wrote:

> Hello Everyone,
> 
> I have written a loop which reads hundreds of .nc files
> and extract information from each .nc file and
> exports that corresponding information as a csv file.
> 
> The loop works fine until it encounters a .nc file which it cannot read
> and the loop stops. I would appreciate if anyone can suggest how can I
> modify
> the loop, whereby the loop will continue to run by bypassing those
> particular
> files which it cannot read.
> 
> In the end I was also hoping to modify the loop such that it
> will generate a report which will inform me which
> files were not read by the loop.  The codes are given below

Perhaps use try()???

cheers,

Rolf Turner

-- 
Honorary Research Fellow
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276



More information about the R-sig-Geo mailing list