Constructor for ImmuneSpaceConnection class.

CreateConnection(
  study = NULL,
  login = NULL,
  password = NULL,
  verbose = FALSE,
  onTest = FALSE
)

Arguments

study

A "character" vector naming the study.

login

A "character". Optional argument. If there is no netrc file a temporary one can be written by passing login and password of an active ImmuneSpace account.

password

A "character". Optional. The password for the selected login.

verbose

A "logical" whether to print the extra details for troubleshooting.

onTest

A "logical" whether to connect to the test server (https://datatools-dev.immunespace.org/) instead of the production server (https://datatools.immunespace.org/).

Value

an instance of an ImmuneSpaceConnection

Details

Instantiates an ImmuneSpaceConnection for study The constructor will try to take the values of the various `labkey.*` parameters from the global environment. If they don't exist, it will use default values. These are assigned to `options`, which are then used by the ImmuneSpaceConnection class.

Examples

if (FALSE) {
# Single study
con <- CreateConnection("SDY269")
# Cross study
con <- CreateConnection("")
}

sdy <- try(CreateConnection("SDY269"))
#> Error in .check_credential(labkey.url.base, verbose) : 
#>   Invalid credential or deactivated account. Check your account in the portal.
if (inherits(sdy, "try-error")) {
  warning("Read the Introduction vignette for more information on how to set
up a .netrc file.")
}
#> Warning: Read the Introduction vignette for more information on how to set
#> up a .netrc file.