remove_extension: Obtains the Root File Name, without Extension.

Description Usage Arguments Details Value Examples

View source: R/utils.R

Description

This function hard codes some of the common extensions that we deal with.

Usage

1

Arguments

fname

A character string of the filename, with the extension present.

Details

If none of the known extensions knit.md, utf8.md, R or Rmd are found, then the last period onwards are removed. See the examples.

If no extensions are found, the original filename is returned.

Value

A character string, with the extension removed.

Examples

1
2
3
4
remove_extension("test.Rmd")
remove_extension("test.knit.md")
remove_extension("test.r.txt")
remove_extension("test_no_extension")

autoharp documentation built on May 30, 2021, 1:07 a.m.