create.label | R Documentation |
This function creates a label object from metadata or an atomic vector
create.label(label, case, meta=NULL, control=NULL,
p.lab = NULL, n.lab = NULL, remove.meta.column=FALSE, verbose=1)
label |
named vector to create the label or the name of the metadata column that will be used to create the label |
case |
name of the group that will be used as a positive label. If the variable is binary, the other label will be used as a negative one. If the variable has multiple values, all the other values will be used a negative label (testing one vs rest). |
meta |
metadata dataframe object or an object of class sample_data-class |
control |
name of a label or vector with names that will be used as a negative label. All values that are nor equal to case and control will be dropped. Default to NULL in which case: If the variable is binary, the value not equal to case will be used as negative. If the variable has multiple values, all the values not equal to cases will be used a negative label (testing one vs rest). |
p.lab |
name of the positive group (useful mostly for visualizations). Default to NULL in which case the value of the positive group will be used. |
n.lab |
name of the negative group (useful mostly for visualizations). Default to NULL in which case the value of the negative group will be used for binary variables and "rest" will be used for variables with multiple values. |
remove.meta.column |
boolean indicating if the label column in the
metadata should be retained. Please note that if this is set to
|
verbose |
integer, control output: |
The function creates a list to be used as label in a SIAMCAT
object. Mainly for interal use, but it can be used to customize your label
(p.lab
and n.lab
will be used as labels during plotting,
for example).
The input for the function can be either a named vector encoding the label or the name of a column in the metadata (needs to be provided as well) which contains the label information.
return either
a list to be used in a SIMCAT object OR
a list with entries meta
and label
,
if remove.meta.column
is set to TRUE
data('meta_crc_zeller')
label <- create.label(label='Group', case='CRC', meta=meta.crc.zeller)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.