Skip to contents

An R6 class for DataSpace Study data.

Constructor

DataSpaceConnection$getStudies()

Super class

DataSpaceR::DataSpaceConnection -> DataSpaceStudies

Active bindings

studies

A character vector of `study_id` values found in the object.

availableDatasets

A table of datasets available in the DataSpaceStudies object.

datasets

A list of data.table objects containing the availableDatasets that were loaded.

variableDefinitions

A list of data.table objects containing the data dictionaries of the integrated data loaded.

treatmentArm

A data.table. The table of treatment arm information for the connected study. Not available for all study connection.

studyInfo

A list. Stores the information about the study.

Methods

Inherited methods


Method new()

Initialize DataSpaceStudy class. See DataSpaceConnection.

Usage

DataSpaceStudies$new(studyIds)

Arguments

studyIds

A character. Name of the study to retrieve. as URL, path and username.


Method print()

Print DataSpaceStudy class.

Usage

DataSpaceStudies$print()


Method loadAvailableDatasets()

Load datasets to the studies object from an availableDatasets object.

Usage

DataSpaceStudies$loadAvailableDatasets(
  availableDatasets = self$availableDatasets,
  downloadDir = tempdir()
)

Arguments

availableDatasets

An `availableDatasets` object or vector of `study_id` values.

downloadDir

Optional, a character path specifying a directory to download. nonstandard datasets. The default is the working temp directory.


Method refresh()

Refresh the study object to update available datasets and treatment info.

Usage

DataSpaceStudies$refresh()


Method clone()

The objects of this class are cloneable with this method.

Usage

DataSpaceStudies$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

if (FALSE) { # \dontrun{
# Create a connection (Initiate a DataSpaceConnection object)
con <- connectDS()

# Get group by `study_id` or pass a filtered `availableStudies` object.
studies <- con$getStudies(c("vtn505", "cvd408"))
studies <- con$getStudies(
  con$availableStudies[grepl("BAMA", data_availability) & species == "Human"]
)

# Load BAMA to the studies object.
studies$loadAssayDatasets("BAMA")
studies$datasets$BAMA

# Inspect variable information of the BAMA dataset
studies$datasetDescriptions$BAMA

# Inspect treatment arm information for all studies in study object
studies$treatmentArm

} # }