TestRWMSetup {rwm}R Documentation

Test setup for rwm package

Description

Tests that the variable `.UserDirectory` has a valid setting.

Usage

TestRWMSetup()

Details

Four tests are done. First that `.UserDirectory` is set and second that it is set to a valid directory. These two tests are repeated for `.UserDate`. Uses built-in R functions `exists()` and `file.exists()`.

Value

Returns TRUE or FALSE according if all 4 tests are passed or not.

Note

This function is used by most of the other functions to validate the setup before attempting to run. The global variable `.UserDirectory` may be set manually as in the examples below and it can be set by running 'InitializeRWM()`.

Author(s)

A.I. McLeod

References

McLeod, A.I. (2008). R Workspace Management: With R Package.

See Also

loadws, savews, InitializeRWM

Examples

#These examples work on my Windows computer but they are easily modified to other
# computers running MacOS or Linux
#Windows Example
## Not run: 
.UserDirectory<-NULL
#generates error
TestRWMSetup()
#now set to a valid directory
.UserDirectory<-"d:/r"
TestRWMSetup()
## End(Not run)

#Mac OS Example
## Not run: 
.UserDirectory<-NULL
#generates error
TestRWMSetup()
#now set to a valid directory
.UserDirectory<-"/Users/aim/R"
TestRWMSetup()
## End(Not run)

#Linnux Example
## Not run: 
.UserDirectory<-NULL
#generates error
TestRWMSetup()
#now set to a valid directory
.UserDirectory<-"/home/faculty/aim/R"
TestRWMSetup()
## End(Not run)


[Package rwm version 1.27 Index]