Skip to content
Prev 156370 / 398506 Next

for-loop for opening a series of files

Hi, you may use list.files('dir-of-your-files', ...) to get the paths
of all the files, and use file.info() to get the date attribute, then
order them by date, and finally in a loop

for(i in paths-of-your-files){
open.ncdf(i, ...)
...
}

Regards,
Yihui
--
Yihui Xie <xieyihui at gmail.com>
Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086
Mobile: +86-15810805877
Homepage: http://www.yihui.name
School of Statistics, Room 1037, Mingde Main Building,
Renmin University of China, Beijing, 100872, China



On Thu, Sep 18, 2008 at 5:13 AM, Brian Pettegrew
<Brian.P.Pettegrew at noaa.gov> wrote: