Description Usage Arguments Details Value Author(s) Examples
The function try to assign a factor vector for a data.frame
object.
See details below.
1 |
df |
A |
sample.group |
A character, number or a vector of factors, from which the factor vector should be deciphered. See details below. |
The function tries to get a factor vector of the same length as the number
of rows in the data.frame
. The determination is done in the following
order: Step 1: It tries to find a column in the data.frame
with the
name as given by sample.group
. If found, this column is transformed
into a factor if not and returned. Step 2: It tries to interpret the
sample.group
as an integer, as the index of the column in the
data.frame
giving the factor. Step 3: When sample.group
itself is a vector of the same length as the data.frame, it is cast to
factor when it is still not and returned.
Otherwise the program stops with error.
A factor vector with the same length as the data.frame
Jitao David Zhang <jitao_david.zhang@roche.com>
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.