Description Usage Arguments Details Value
View source: R/fun-rename_reference_observations.R
Change category descriptions in a selected variable to enable prettier plotting.
1 2 3 4 5 6 7 | rename_reference_observations(
X,
In_Variable = "treatment",
Replacee = "nt",
Replacers,
return.composite = TRUE
)
|
X |
data frame |
In_Variable |
name of the variable whose values are to be altered (character) |
Replacee |
name of the value of |
Replacers |
character vector of values that will replace |
return.composite |
logical flag whether to return just only reference rows or the whole data set (with references renamed) |
Experimental data are kept in a data frame and some observations constitute a reference group. In order to be able to show them alongside test observations, they may need to have their categorical variables altered e.g. non-treated cells can be renamed to cells treated for 0 hours.
The categorical variable can be stored as character or as a factor and this will be preserved but the replaced level will be dropped.
Grouping (by dplyr
) will be preserved.
A data frame. If return.composite
is FALSE
only the (renamed)
observations will be returned. It TRUE
, the returned data frame
contains the renamed reference observations as well as the original non-reference observations.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.