I tried norm, but I think it gives the wrong result. (the norm of c(1, 2, 3) is sqrt(1*1+2*2+3*3), but it returns 6..
norm
c(1, 2, 3)
sqrt(1*1+2*2+3*3)
6
norm(c(1,1), type="2") # 1.414214 norm(c(1, 1, 1), type="2") # 1.732051