with_sample_covs: Retrieves sample covariates with option to use custom...

View source: R/facile_api_extras.R

with_sample_covsR Documentation

Retrieves sample covariates with option to use custom covariates by user.

Description

This returns a mix of custom covs that might be provided by a passed (wide) data.frame and the ones stored in the datastore. Covariates passed in by an extra data.frame or the original sample descriptor are given higher precedence.

Usage

with_sample_covs(
  x,
  covariates = NULL,
  custom_covariates = NULL,
  custom_key = Sys.getenv("USER"),
  ...,
  verbose = FALSE
)

Arguments

x

a sample descriptor (facile_frame)

covariates

the names of the covariates to retrieve from the datstore. Defaults to NULL, which is all of them.

custom_covariates

a wide (sample, dataset, cov1, cov2, ...) data.frame of extra covariates the user wants to add to the sampel descriptor x.

custom_key

for FacileData::with_sample_covariates()

Value

a wider version of x with more covariates attached to it.


facileverse/FacileAnalysis documentation built on March 15, 2024, 6:44 p.m.