Modify dataframe-columns to standardize them by a constant denominator.

standardize_at(x, .at, denominator)

Arguments

x

Dataframe.

.at

A character vector of names, positive numeric vector of positions to include, or a negative numeric vector of positions to exlude. Only those elements corresponding to .at will be modified. If the tidyselect package is installed, you can use vars() and the tidyselect helpers to select elements.

denominator

A numeric vector of length 1.

Value

A data.frame.

See also

Other general functions to perform common transforms: convert_unit

Examples

dfm <- data.frame(a = 1:3, b = 11:13) standardize_at(dfm, "a", denominator = 100)
#> a b #> 1 0.01 11 #> 2 0.02 12 #> 3 0.03 13
standardize_at(dfm, names(dfm), denominator = 100)
#> a b #> 1 0.01 0.11 #> 2 0.02 0.12 #> 3 0.03 0.13