Some people have a hard time coming to terms with vectorization. If it is hard for you, you may be trying to make it more complicated than it is.

The essence of vectorization is simplicity. (There can be complicated ways to vectorize specific computations, but that should be considered as an aberration from the main point.)

If you are not getting it, relax and let it sink in slowly.

Resources

This includes a quick introduction to vectorization including the recycling rule.

Circles 3 and 4 give a more complete introduction to vectorization.

Back to top level of Impatient R

Kommentarer inaktiverade för More R Vectorize

See more

Explore more content and blog posts.

  • jun 25, 26

    I’d like to do a song of great social and political import. The code that created the illustrations in Tao Te Programming is now available as the TaoTeProgramming package on [...]

  • jun 25, 26

    Another of the all ye entering here. Issue When subscripting an xts object, columns that don’t exist in the object are silently ignored. Example First, create an xts object: xtx [...]

  • jun 25, 26

    Posts by page views Interview with a forced convert to R from Matlab A first step towards R from spreadsheets Plot ranges of data in R A statistical review of [...]