Learn R Programming

pcutils (version 0.2.8)

hebing2: Group your data

Description

Group your data

Usage

hebing2(otutab, group_df, margin = 2, act = "mean")

Value

data.frame

Arguments

otutab

data.frame

group_df

group data.frame with two columns (id and group). The same ID can be mapped to multiple groups.

margin

1 for row and 2 for column(default: 2)

act

do (default: mean)

Examples

Run this code
data(otutab)
hebing2(otutab, data.frame(id = c("NS1", "NS2", "NS1", "NS3"), group = c("A", "A", "B", "B")))

Run the code above in your browser using DataLab