R/convertFilename2Date.R

convertFilename2Date <- function(
  ##title<< Convert file name patterns to R date object
    file.names        ##<< character vector: names of the files
    , fun.extr.string ##<< function
    , fun.conv.string ##<< function
  )
##description<<
## This function converts parts of netCDF file names to date strings (in case the
## file name contains date information). This is used, e.g.
## in transNcdfCutFiles.   
##seealso<<
##\code{\link{transNcdfCutFiles}}  
{
   date   <- do.call(fun.conv.string, list( do.call(fun.extr.string, list(file.names))))
   ##value<< POSIXct object with the date.
   return(date)
}

Try the ncdf.tools package in your browser

Any scripts or data that you put into this service are public.

ncdf.tools documentation built on May 2, 2019, 4:19 a.m.