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)

GarrettMooney/moonmisc documentation built on Oct. 19, 2019, 7:51 p.m.