pathGeneratorMovement: selectTemplates

Description Usage Arguments Value Examples

View source: R/pathGeneratorMovement.R

Description

File movements in disk

Usage

1
pathGeneratorMovement(fileName, suffix = NULL, destination = "", move = FALSE)

Arguments

fileName

File name(s) in a character vector. It must in the current work directory. Make sure file(s) exists.

suffix

(optional) A character string representingthe suffix of the file, or NULL. Default is NULL.

destination

(optional) The directory name if not doing file moving, or the directory path if doing file moving. Default is "". Make sure the destination exists.

move

(optional) A boolean. TRUE for file moving, FALSE for generating file path. Default is FALSE.

Value

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# move myFile.txt to C:/Users
cat("test", file = "myFile.txt")
pathGeneratorMovement(fileName = "myFile", suffix = ".txt",
                      destination = "C:/Users/new", move = TRUE)
pathGeneratorMovement(fileName = "myFile.txt",
                      destination = "C:/Users/new", move = TRUE)

# generate file path "C:/Users/new/myFile.txt".
pathGeneratorMovement(fileName = "myFile", suffix = ".txt",
                      destination = "/new", move = FALSE)
pathGeneratorMovement(fileName = "myFile.txt",
                      destination = "/new")

MichelleMengzhi/hmtp documentation built on Dec. 12, 2019, 12:54 a.m.