Learn R Programming

TopKLists (version 1.0.8)

l2norm: Calculate the L2 norm

Description

Calculated the L2 norm.

Usage

l2norm(x, na.rm = TRUE)

Value

The L2 norm of x

Arguments

x

Objects for which the L2 norm is to be calculated

na.rm

Whether or not to remove NA values from the calculation

Author

Shili Lin <shili@stat.ohio-state.edu>

Examples

Run this code
set.seed(122)
vals <- sample(1:100, 10)
l2norm(vals)

Run the code above in your browser using DataLab