SpatialEpi (version 1.1)

normalize: Normalize a vector

Description

Function to Normalize a vector, possibly over a restricted set of indices

Usage

normalize(p, include.indices = NA)

Arguments

p
vector to normalize
include.indices
indices to normalize over. Returns 0 for indices not included

Value

  • p.primenormalized vector

Examples

Run this code
x <- c(1:5)
normalize(x, c(1,1,1,0,0))

Run the code above in your browser using DataCamp Workspace