Learn R Programming

plotKML (version 0.8-3)

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.

See Also

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

Examples

Run this code
# NOT RUN {
normalizeFilename("name[%].txt")
normalizeFilename("name .txt")
# }

Run the code above in your browser using DataLab