Learn R Programming

mixlink (version 0.1.5)

normalize: Normalize

Description

Scale a numeric vector by the sum of its elements

Usage

normalize(x)

Arguments

x

A numeric vector

Value

x / sum(x)

Examples

Run this code
# NOT RUN {
  x <- c(1,1,1,1)
  normalize(x)
# }

Run the code above in your browser using DataLab