prSource: Source a R script

Description Usage Arguments See Also Examples

Description

Source a R script in the "scripts" folder of the project.

Usage

1
prSource(name, subdir = ".")

Arguments

name

Name of the script to execute. It can also contain the subfolder where the script is stored.

subdir

subdirectory where the script is located. The subdirectory can also be directly specified in the parameter name.

See Also

prLibrary, prLoad, prSave

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
projectPath <- file.path(tempdir(), "test")
prInit(projectPath)

prScript("helloWorld")

# Edit the script so that it does something cool

prSource("helloWorld")

# Source a file in a subdirectory
prScript("myScript", subdir = "testdir")
prSource("myScript", subdir = "testdir")

# Or equivalently
prSource("testdir/myScript")

cuche27/project documentation built on May 14, 2019, 12:50 p.m.