get_path: Get the Folder Path Containing File

Description Usage Arguments Details Value Author(s) Examples

View source: R/get-path.R

Description

get_path returns the folder path that contains a specified file.

Usage

1
get_path(file = "repos.ecm", where = "~")

Arguments

file

File name to look for.

where

Folder name where to look for.

Details

When the file name is not specified, get_path will look for the file "doctoral-research.ecm".

Value

A character indicating the folder path.

Author(s)

Erick Albacharro Chacon-Montalvan

Examples

1
2
3
4
5
6
7
# Create a file to look for
data_path <- file.path(tempdir(), "data")
dir.create(data_path)
write("this is a test", file.path(data_path, "data.RData"))

# Find the path of the file
get_path(file = "data.RData", where = tempdir())

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