Learn R Programming

filenamer (version 0.3)

as.character.filename: Coerce a character to a filename

Description

This function coerces a filename into a character.

Usage

# S3 method for filename
as.character(x, tag.char = NULL, simplify = FALSE, sanitize = TRUE, ...)

Value

a character vector

Arguments

x

a filename object

tag.char

character to delimit tags, defaults to '_'

simplify

if TRUE, all timestamps are omitted

sanitize

if TRUE, file name is sanitized by removing problematic characters, replacing whitespace, and converting to lowercase

...

unused arguments

Examples

Run this code
x <- "data_post_2011-01-02.txt"
fn <- as.filename(x)
print(as.character(fn))

Run the code above in your browser using DataLab