prioritized.grouping/man/prioritized_grouping.Rd

44 lines
1.4 KiB
Text
Raw Normal View History

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/prioritized_grouping.R
\name{prioritized_grouping}
\alias{prioritized_grouping}
\title{Solve grouping based on priorities or costs.}
\usage{
prioritized_grouping(
data,
cap_classes = NULL,
excess_space = 20,
pre_grouped = NULL,
seed = 6293812
)
}
\arguments{
\item{data}{data set in wide format. First column should be ID, then one column
for each group containing cost/priorities.}
\item{cap_classes}{class capacity. Numeric vector length 1 or length=number
of groups. If NULL equal group sizes are calculated. Default is NULL.}
\item{excess_space}{allowed excess group fill in percentage. Default is 20.
Supplied group capacities will be enlarged by this factors and rounded up.}
\item{pre_grouped}{Pre grouped data set. Optional. Should contain two
columns, 'id' and 'group', with 'group' containing the given group index.}
\item{seed}{specify a seed value. For complex problems.}
}
\value{
list of custom class 'prioritized_groups_list'
}
\description{
Solve grouping based on priorities or costs.
}
\examples{
2024-10-10 13:22:22 +02:00
# prioritized_grouping(
# data=read.csv(here::here("data/prioritized_sample.csv")),
# pre_grouped=read.csv(here::here("data/pre_grouped.csv"))) |> plot()
data.frame(id=paste0("id",1:100),
matrix(replicate(100,sample(c(1:5,rep(NA,15)),10)),ncol=10,byrow = TRUE)) |>
prioritized_grouping()
}