Learn R Programming

datplot (version 1.0.0)

scaleweight: Scales the content of a column according to group membership

Description

Requires a dataframe with one variable and one value column.

Usage

scaleweight(DAT_df, var = c("all", 2), val = 5)

Arguments

DAT_df

a dataframe

var

the index of the column that should be used as the group variable, OR "all" (note: all non-numeric values will result in the weight being scaled across all objects)

val

the column that should be scaled (value / sum(values))

Value

the same dataframe, with scaled values in the specifies column