get_grouping: Generate a matrix of group membership for all individuals

View source: R/utils.R

get_groupingR Documentation

Generate a matrix of group membership for all individuals

Description

Establish the group membership of individuals based on the metadata across all observations using the vector of subject identifier and the matching vector of group membership.

Usage

get_grouping(ind, group)

Arguments

ind

vector of subject identifier (individual) for each observation

group

vector of group membership for each observation

Value

data.frame with as rows each unique Individual ID and 2 columns (ind and group).

See Also

Other Analysis: get_ind_time_matrix(), santaR_CBand(), santaR_auto_fit(), santaR_auto_summary(), santaR_fit(), santaR_plot(), santaR_pvalue_dist(), santaR_pvalue_fit(), santaR_start_GUI()

Examples

## 3 subjets in 2 groups
ind   <- c('ind_1','ind_1','ind_1','ind_2','ind_2','ind_3')
group <- c('g1','g1','g1','g2','g2','g1')
get_grouping(ind, group)
#     ind group
# 1 ind_1    g1
# 2 ind_2    g2
# 3 ind_3    g1

## 8 subjects in 2 groups
ind   <- acuteInflammation$meta$ind
group <- acuteInflammation$meta$group
get_grouping(ind, group)
#    ind   group
# 1 ind_1 Group1
# 2 ind_2 Group2
# 3 ind_3 Group1
# 4 ind_4 Group2
# 5 ind_5 Group1
# 6 ind_6 Group2
# 7 ind_7 Group1
# 8 ind_8 Group2


santaR documentation built on May 24, 2022, 1:06 a.m.