Skip to contents

Extract current active file name

Usage

current_fname(line)

Arguments

line

1L-character vector contains the path of current file. Can be passed from `rstudioapi::getActiveDocumentContext()$path`

Value

the name of current active file

Examples

current_fname("~/Work/cheat_sheet/snippets.R")
#> [1] "snippets.R"