Skip to contents

Adds a condition tag to the data frame allowing analysis based upon the tag

Usage

add_condition_tag(df, parameters)

Arguments

df

Data Frame or Tibble, with the following columns:

  • sweep

parameters

Data Frame or Tibble with experiment parameters, expected columns are as follows:

  • condition_start - Integer

  • condition_end - Integer

  • condition - Character

Value

Data Frame or Tibble with the additional column: condition.

Details

Uncategorized events will default to NA.

Examples

simple_tbl <- tibble::tibble(sweep = as.ordered(rep(1:5, each = 2)))
user_drug_args <-
  tibble::tribble(
    ~condition_start, ~condition_end, ~condition,
    1, 2, "control",
    4, 5, "drug_1"
  )

add_condition_tag(
  df = simple_tbl,
  parameters = user_drug_args
)
#> # A tibble: 10 × 2
#>    sweep condition
#>    <ord> <chr>    
#>  1 1     control  
#>  2 1     control  
#>  3 2     control  
#>  4 2     control  
#>  5 3     NA       
#>  6 3     NA       
#>  7 4     drug_1   
#>  8 4     drug_1   
#>  9 5     drug_1   
#> 10 5     drug_1