get_ratio | R Documentation |
Calculates the ratio of two numeric
columns
in a data.frame, and indicates if there are missing values. Calculation is:
trt - ctr
. Typically used to calculate the ratio of two log2
transformed SILAC/label-free intensity columns.
get_ratio(
data,
treatment,
control,
ratio_colname = "ratio",
missing_colname = "missing",
bind = TRUE
)
data |
|
treatment , control |
|
ratio_colname |
|
missing_colname |
|
bind |
|
Returns data
with 2 new columns: ratio (a numeric column) and
missing (a character column indicating if there was missing values in
treament
and/or control
). Returns a named list
if bind = FALSE
.
my_data <- data.frame(
treatment = c(30, NA, 12, NA),
control = c(20, 12, NA, NA)
)
my_data2 <- get_ratio(my_data, treatment, control)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.