Description Usage Arguments Details Value Examples
View source: R/metrics_to_fractions.R
Accepts as arguments multiple sets of metrics and then calculates the proportion that each metric represents out of the total sum. Effectively assumes that each metric is an object count, and returns the proportion of objects from each set.
1 | metrics_to_fractions(.df, ..., .prefix = "", .suffix = "")
|
.df |
A data frame containing tidycyte data. |
... |
< |
.prefix |
An optional character string containing a prefix if you wish to assign the fraction to new metric names. |
.suffix |
An optional character string containing a suffix if you wish to assign the fraction to new metric names. |
Note that in practice, this assumes that each count is mutually exclusive. For example, if you count green, red, and yellow (green and red) objects, then ensure that the yellow objects do not contain green-only or red-only objects. Depending on the type of data, you may (or may not) be able to subtract these off as needed.
A data frame containing updated or new metrics containing fractions.
1 2 3 | df %>% metrics_to_fractions(Confluence,mAzalea,`h2-3`) # updates metrics in place
df %>% metrics_to_fractions(Confluence,mAzalea,`h2-3`, .prefix="fraction_", .suffix="_of_all")
df %>% metrics_to_fractions(mAzalea,`h2-3`, .prefix="fraction_", .suffix="_of_fluorescent")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.