is_in_analysis: Which Rows an Analysis Was Made On

View source: R/model.R

is_in_analysisR Documentation

Which Rows an Analysis Was Made On

Description

'TRUE' for each row of the data frame the analysis was made on, 'FALSE' for the others: the rows filtered out (with the pipe or with 'filter'), those with a weight of 0, and the supplementary individuals of a principal component analysis. Use it to describe the analysed population:

'data |> dplyr::filter(is_in_analysis(res)) |> tabxplor::tab(SEXE, AGE)'

Usage

is_in_analysis(res)

Arguments

res

An analysis made with multiple_correspondence_analysis or principal_component_analysis (or with FactoMineR::MCA() or PCA(), or GDAtools::speMCA() or csMCA()).

Value

A logical vector, one value per row: inside dplyr::filter() or dplyr::mutate(), of the data frame being read; outside, of the data frame the analysis started from.

Examples

data(tea, package = "FactoMineR")
res.mca <- multiple_correspondence_analysis(tea, 1:18, filter = age < 30)

tea |>
  dplyr::filter(is_in_analysis(res.mca)) |>
  tabxplor::tab(sex, SPC)

ggfacto documentation built on Sept. 23, 2026, 1:08 a.m.