Learn R Programming

starter (version 0.1.16)

create_symlink: Establish symbolic link between folders

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", ...)

Value

NULL, Places the path or pathname to the link.

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()

Author

Daniel D. Sjoberg

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.

See Also

R.utils::createLink()

Examples

Run this code
if (FALSE) { # interactive()
# 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")
}

Run the code above in your browser using DataLab