format_path: Format the highlighted file path to use individual quoted and...

View source: R/format_path.R

format_pathR Documentation

Format the highlighted file path to use individual quoted and comma-separated elements

Description

This function formats a file path highlighted in the source pane to work with here::here() or file.path() by separating the string into its component parts and quoting and comma-separating these elements. For best use, we recommend using this functionality via the associated AddIn, or by binding the AddIn to a keyboard shortcut, rather than calling the function interactively from the console.

Usage

format_path(fns = c("here", "file.path"))

Arguments

fns

Defines the functions to target for cleaning. Default is to clean the file paths of both here() and file.path(), but one or the other can be specified if running the command interactively (i.e. not via the AddIn).

Value

Updated path as recommended by here::here(), split into individual quoted and comma-separated segments.


mcguinlu/pathformatr documentation built on Aug. 18, 2022, 11:39 a.m.