Description Usage Arguments Value Examples
View source: R/extract_subpopulations.R
extract_subpopulations
identifies clusters in the reference and
population sets and reports the frequency of points in each cluster for the
two sets.
1 | extract_subpopulations(population, reference, variables, k)
|
population |
tbl with grouping (metadata) and observation variables. |
reference |
tbl with grouping (metadata) and observation variables. Columns of |
variables |
character vector specifying observation variables. |
k |
scalar specifying number of clusters. |
list containing clusters centers (subpop_centers
), two
normalized histograms specifying frequency of each clusters in population
and reference (subpop_profiles
), and cluster prediction and distance to
the predicted cluster for all input data (population_clusters
and
reference_clusters
).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | data <- tibble::tibble(
Metadata_group = c(
"control", "control", "control", "control",
"experiment", "experiment", "experiment", "experiment"
),
AreaShape_Area = c(10, 12, NA, 16, 8, 8, 7, 7),
AreaShape_Length = c(2, 3, NA, NA, 4, 5, 1, 5)
)
variables <- c("AreaShape_Area", "AreaShape_Length")
population <- dplyr::filter(data, Metadata_group == "experiment")
reference <- dplyr::filter(data, Metadata_group == "control")
extract_subpopulations(
population = population,
reference = reference,
variables = variables,
k = 3
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.