Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

normalizeFilename

Normalize filename string


Description

Remove all reserved characters from the file name.

Usage

normalizeFilename(x, form = c("default", "8.3")[1], 
                 fix.encoding = TRUE, sub.sign = "_")

Arguments

x

input character

form

target format (standard or the short 8.3 file name)

fix.encoding

logical; specifies whether to fix the encoding

sub.sign

substitution symbol

Details

This function removes all reserved characters: (less than), (greater than), (colon), (double quote), (forward slash), (backslash), (vertical bar or pipe), (question mark), (asterisk), and empty spaces, from the file name. This is important when writing a list of objects to an external file (e.g. KML) as it prevents from creating erroneous file names.

Author(s)

Tomislav Hengl

See Also

utils::shortPathName, RSAGA:set.file.extension

Examples

normalizeFilename("name[%].txt")
normalizeFilename("name .txt")

plotKML

Visualization of Spatial and Spatio-Temporal Objects in Google Earth

v0.8-1
GPL
Authors
Tomislav Hengl [cre, aut], Andrea Gilardi [ctb], Pierre Roudier [ctb], Dylan Beaudette [ctb], Edzer Pebesma [ctb], Michael Blaschek [ctb]
Initial release
2021-04-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.