Pedicularis groenlandica

Wetlands and landscapes

Data science, water, isotopes, and ecosystems

optimization

Vectorize in R

Letting the Vectorize function do the heavy-lifting when it comes to applying complicated control flows.

Jason Mercer

8 minutes read

One of the cool things about R is that it is a vectorized language. This means that you can apply a vector (i.e., a series of values) to functions like sqrt and log without the need to write a for loop. While I was naive to how useful this was when learning R, in retrospect, I now very much appreciate this behavior.

Recent posts

See more

Categories

About

I am a PhD candidate at the University of Wyoming, studying mountain wetlandscapes.