fetch_subjects: Fetch subject data from the Generable API

View source: R/geco_subjects.R

fetch_subjectsR Documentation

Fetch subject data from the Generable API

Description

Fetch subject data from the Generable API for a specific project.

Usage

fetch_subjects(
  project = NULL,
  project_version_id = NULL,
  event_type = NULL,
  annotate = T,
  .dots = list(),
  ...
)

Arguments

project

Project name. If NULL, defaults to value of environment variable GECO_API_PROJECT

project_version_id

Project version. If NULL, defaults to the most recent version of the project if provided, or the value of environment variable GECO_API_PROJECT_VERSION

event_type

If this argument is provided, event data that matches this event type will be joined into the return data.frame. Default is NULL (no event data).

annotate

if 'TRUE', annotate subject data with dose data. Default is 'TRUE'.

.dots

Alternate method of passing filters as a named list, rather than in ...

...

Optional filters applied to subjects data, provided as name-value pairs where names are fields and values contain a subset of valid values Example: trial_name = c('trial-A', 'trial-N'), performance_status = c(0,1)

Details

This function retrieves subject data from the Generable API. This includes subject-level covariates.

As a convenience, event data can be included in the returned 'data.frame' by specifying the 'event_type' argument; the data returned from fetch_events matching the 'event_type' will be merged into the returned data.

Authentication (see login) is reqiured prior to use and this pulls subject data from the Generable API.

Value

data.frame of subject-level data, including information about the trial and trial_arms

Note

A project can be specified by using the project name or a specific project version.

  1. If a project is specified using the name, data is fetched for the latest version of the project.

  2. If a project is specified using the project version, the project name is not required.

  3. If neither a project nor a project version is provided, the default project or project version is used. These are set by the environment variables GECO_API_PROJECT and GECO_API_PROJECT_VERSION


generable/rgeco documentation built on Oct. 16, 2024, 2:45 a.m.