write_test: A simple test to see if R has write permissions.

Description Usage Arguments Value

View source: R/write_test.R

Description

This simply attempts to create a folder in the named directory (the working directory by default). If successful, the test folder is deleted.

To minimize the risk of overwriting or deleting an existing folder, the test folder is created using safe_folder(). As a result, the test may fail under the very unlikely circumstance that folders named "temp1" to "temp15" exist in the test directory. The user will be notified should this occur.

Usage

1
write_test(test_directory = ".")

Arguments

test_directory

The directory you want to test against. Defaults to "." for the current working directory.

Value

The function returns a boolean value TRUE on success (indicating R has write permissions in the test directory). On failure, the function returns a message articulating where the attempt to write failed.


pocdata/pocr documentation built on Jan. 5, 2022, 9:54 a.m.