strip_extension: Strip File Extension

Description Usage Arguments Examples

View source: R/misc.R

Description

Strips the extension from a file name. By default, we assume the extension is separated from the file name by a single period; however, the lvl argument lets us specify how many periods are used in forming the file extension.

Usage

1
strip_extension(x, lvl = 1)

Arguments

x

the file name, including extension.

lvl

the number of '.' used in defining the file extension.

Examples

1
2
x <- "path_to_file.tar.gz"
strip_extension(x, lvl=2)

kevinushey/Kmisc documentation built on May 20, 2019, 9:08 a.m.