file_ext: Determine a File's Extension

file_extR Documentation

Determine a File's Extension

Description

Based on the separating character, determine the file extension.

Usage

file_ext(path, sep_char = ".")

Arguments

path

character value of the file path possibly with an extension.

sep_char

character value of the separator that delineates the extension from the file path.
Generally, this will be ⁠."⁠, but for some API URLs, the extension is actually a query component, so the separator may sometimes need to be "=".

Value

character value of the extension (file_ext).

See Also

Other utilities: foy(), ifnull(), messages, named_null_list(), package_version_finder(), round_na.interp(), update_list()

Examples

   file_ext("home/folders.with.dots/stuff/ok.csv")
   file_ext(NMME_urls()[[1]])
   file_ext(NMME_urls()[[1]], "=")


weecology/portalPredictionsModels documentation built on Jan. 31, 2024, 12:03 p.m.