get_basename_vis: Determine the basename of a NetCDF file

View source: R/get_basename_vis.R

get_basename_visR Documentation

Determine the basename of a NetCDF file

Description

This function determines the basename of either a file/URL path or an 'nc' object (using nc$filename).

Usage

get_basename_vis(infile, nc = NULL)

Arguments

infile

Filename of input NetCDF file. This may include the directory (character).

nc

Alternatively to infile you can specify the input as an object of class ncdf4 (as returned from ncdf4::nc_open).

Details

When the origin of the file path is a local .nc file then get_basename_vis() is equivalent to base::basename().

get_basename_vis() also handles the case of infile/nc originating from a URL.

The value of get_basename_vis() always ends in ".nc".

If both infile and nc are specified, infile is ignored.

Value

A character string giving the basename.


cmsafvis documentation built on Sept. 30, 2024, 5:07 p.m.