create_symlink: Establish symbolic link between folders

View source: R/create_symlink.R

create_symlinkR Documentation

Description

The starter_symlink() function is an OS agnostic function that creates symbolic links between two folders. The function is, at its core, a wrapper for the R.utils::createLink() function with opinionated defaults. The function must be called in an environment where the working directory is known (e.g. using ⁠*.Rproj⁠, setwd(), etc.).

Usage

create_symlink(to, name = "secure_data", ...)

Arguments

to

target file or directory to which the shortcut should point to.

name

symbolic link folder name. Default folder name is "secure_data"

...

arguments passed on to R.utils::createLink()

Details

A symbolic link is a special kind of file that points to another file/folder. A symbolic link does not contain the data in the target file. It simply points to another entry somewhere in the file system. This allows symbolic links to link to directories or files on remote network locations. Depending on your operating system, a link may not establish if the originating path is a network drive.

Value

NULL, Places the path or pathname to the link.

Author(s)

Daniel D. Sjoberg

See Also

R.utils::createLink()

Examples


# Using `starter_symlink()` to establish a symbolic link to a
# mapped networked data folder.
# The default name of the symlink folder is 'secure_data'
create_symlink("O:/Outcomes/Project Folder/Data")


starter documentation built on Oct. 15, 2024, 5:06 p.m.