remove_extension {autoharp}R Documentation

Obtains the Root File Name, without Extension.

Description

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

Usage

remove_extension(fname)

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


remove_extension("test.Rmd")
remove_extension("test.knit.md")
remove_extension("test.r.txt")
remove_extension("test_no_extension")


[Package autoharp version 0.0.8 Index]