These functions are only intended to be used at CPP

See Wiki QMS 1.6 Standard Directory Structure.

path_sponsor(sponsor, path = ".")

path_drug(drug, sponsor = "*", path = ".")

path_project(project_number, drug = "*", sponsor = "*", path = ".")

path_stage(stage, project_number = "*", drug = "*", sponsor = "*", path = ".")

path_substage(
  substage,
  stage = "*",
  project_number = "*",
  drug = "*",
  sponsor = "*",
  path = "."
)

path_dataorig(path = ".")

path_r_includes(path = ".")

path_r_library(path = ".", version = NULL)

browse_project_email(path = ".")

browse_project_sharepoint(path = ".")

browse_project_gantt(path = ".")

browse_project_tracker(path = ".")

Arguments

sponsor, drug, project_number, stage, substage

character vectors of directory patterns or names. Wildcard expansion (also known as 'globbing') is supported. See Sys.glob.

path

character vector of file or directory paths that will be truncated to the substage, stage, project number, drug, or sponsor level. Ignored in path_* functions when the first argument is provided (i.e., path is ignored if the sponsor argument is provided to path_sponsor()).

version

a single R version (major and minor) as a character. This argument is used to identify which library tree to use in path_r_library.

Value

For path_* functions, the path(s) to the sponsor, drug, or project directory corresponding to either: the path of a file or directory; or the name(s) of the sponsor, drug, or project number.

For browse_project_* functions, invisibly returns NULL.

Details

path_*

path_sponsor() returns the path to sponsor directories.

  • When only the path argument is set (including the default, path = "."), returns one sponsor directory corresponding to each path.

  • When the sponsor argument is provided, path is ignored and all sponsor directories matching any element of sponsor are returned.

path_drug() returns the path to drug directories, which are one directory below sponsor directories.

  • When only the path argument is set (including the default, path = "."), returns one drug directory corresponding to each path.

  • When the drug argument is provided, path is ignored and all drug directories matching any element of drug are returned. Further subsetting of drug directories can be done by providing sponsor.

path_project() returns the path to project directories, which are one directory below drug directories.

  • When only the path argument is set (including the default, path = "."), returns one project directory corresponding to each path.

  • When the project_number argument is provided, path is ignored and all project directories matching project_number are returned. Further subsetting of project directories can be done by providing drug and/or sponsor. Resulting directories will match at least one element of both drug and sponsor.

browse_project_*

browse_project_email() opens email aliases in Outlook on the web in a new browser tab.

  • When called without any arguments, opens the email alias corresponding to the working directory.

  • When one or more paths are provided to path, opens all corresponding project email aliases.

  • Email aliases that do not exist or you do not have access to might open, but not display email content.

browse_project_sharepoint() opens internal SharePoint sites in a new browser tab.

  • When called without any arguments, opens the SharePoint site corresponding to the working directory.

  • When one or more paths are provided to path, opens all corresponding SharePoint sites.

  • SharePoint sites that do not exist are expected to be skipped.

browse_project_gantt() and browse_project_tracker() open project management services.

  • When called without any arguments, opens the project gantt chart or tracker corresponding to the working directory.

  • When one or more paths are provided to path, opens all corresponding project gantt charts or trackers.

  • Projects that do not exist or you do not have access to might open, but not display content.

Examples

if (FALSE) { # \dontrun{
# the below examples reference a test directory on CPP's file system.
cd("/misc/dceuticals/doloxan/009002/")

# the default behavior is to return the path to the sponsor, drug, or project.
path_sponsor()
path_drug()
path_project()

# or open the resource for the corresponding project.
# note that these will not produce desired results with the test dceuticals
# directory because the project alias and SharePoint site do not exist.
browse_project_email()
browse_project_sharepoint()

# the below examples do not rely on the working directory
cd("~")

# use the pattern "*" to match any sponsor, drug, or project number.

# get paths to all sponsor directories:
path_sponsor("*")

# get paths to sponsor directories that begin with "bio":
path_sponsor("bio*")

# get paths to drug directories that end with "umab":
path_drug("*umab")

# get paths to project directories that begin with "20" for drugs that end
# with "umab" or start with "ab":
path_project("20*", drug = c("*umab", "ab*"))

# open email aliases for all projects where the project number starts with
# "006" and ends with "58"
browse_project_email(path_project("006*58"))

} # }