calc_log2_df: Calculate log2 values in a dataframe

Description Usage Arguments Examples

View source: R/calc_log2_df.R

Description

Reads a data-frame and calculates log2 for each value. Non-numeric columns that should be transformed can be excluded by adding the column name in exclusion vector. For partial matching of column names use complete_match = FALSE. Transformed columns can be renamed using the log_lab argument. Missing values can be either replaced with 0 or removed by adjusting the rm_zero argument.

Usage

1
2
calc_log2_df(x, log_lab, rm_zero = TRUE, exclusion = c(),
  complete_match = TRUE, append = FALSE)

Arguments

x

Dataframe containing only numeric values.

log_lab

Character tag to be added in front of every column name of the dataframe (e.g. "Log2_".

rm_zero

If TRUE, missing values will remain NA. If set to FALSE missing values will be replaced by 0. By default rm_zero = TRUE.

exclusion

Vector containing labels from the columns that should be excluded. Even a part of the label is enough.

complete_match

Logical with default value TRUE. If exclusion vector contains exactly the column names of the excluded columns, leave the complete_match to TRUE. For partial matching of the columns switch to FALSE

append

Logical with default value FALSE. If set TRUE processed data will be added in the starting dataframe. If FALSE, the processed columned will be merged only with the excluded ones.

Examples

1
calc_log2_df(x, log_lab = "my_label", rm_zero = FALSE)

tkostas/komics documentation built on May 24, 2019, 7:31 a.m.