Get the path to the currently active file in the RStudio editor.
current_file(...)Arguments passed on to rstudioapi::getSourceEditorContext
idThe ID of a particular document, as retrieved by documentId()
or similar. Supported in RStudio 2022.06.0 or newer.
File path.
if(interactive()) current_file()