Learn R Programming

iMRMC (version 2.1.0)

createGroups: Assign a group label to items in a vector

Description

Assign a group label to items in a vector

Usage

createGroups(items, nG)

Value

A data frame containing the items and their group labels

Arguments

items

A vector of items

nG

The number of groups

Examples

Run this code
x <- paste("item", 1:10, sep = "")
df <- createGroups(x, 3)
print(df)

Run the code above in your browser using DataLab