Learn R Programming

SpatialEpi (version 1.2.3)

normalize: Normalize vector to sum to 1.

Description

Divide each element in the vector by the sum of the vector elements.

Usage

normalize(x)

Arguments

x

Vector to be normalized

Value

Normalized vector

Examples

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

Run the code above in your browser using DataLab