getwd_short: Cut Current Working Directory Filepath

Description Usage Arguments Details Value Author(s) Examples

View source: R/get-path.R

Description

getwd_short finds the absolute filepath of a folder that contains the current working directory.

Usage

1
getwd_short(foldername)

Arguments

foldername

Folder name that contains current working directory.

Details

getwd_short gets the filepath of the current working directory and shortens it given a folder name inside this path.

Value

A character indicating the folder path.

Author(s)

Erick A. Chacon-Montalvan

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
# Set working directory to tempdir
project_path <- file.path(tempdir(), "my-project")
dir.create(project_path)
code_path <- file.path(project_path, "analysis")
dir.create(code_path)
setwd(code_path)

# Find the path of the file
getwd()
getwd_short(foldername = "my-project")

## End(Not run)

ErickChacon/day2day documentation built on May 6, 2019, 4:03 p.m.