Learn R Programming

wrappr (version 0.1.0)

set_temp_wd: Sets a temporary working directory within the function scope

Description

Sets a temporary working directory within the function scope

Usage

set_temp_wd(
  temp_cwd,
  func,
  ...,
  err_msg = "An error has occured in the function set_temp_wd"
)

Value

Unknown. The return type from the param func.

Arguments

temp_cwd

character. Folder path to temporarily set the working directory

func

function. A function that used a directory path

...

Additional arguments to be passed to the param func.

err_msg

character. Message sent to stop function if an error occurs.

Examples

Run this code
if (FALSE) {

temp_wd <- "example/folder/address/to/change"

get_data <- set_temp_wd(temp_wd, read.csv, file = "file.csv")

}

Run the code above in your browser using DataLab