Grasping the syntax was fairly easy, however, understanding what library is best for what job is not. What can also be tricky is understanding the /principles/ behind the way library's (and base R, for that matter) are built, so as to utilise the functions in the most edfecient manner. It takes some research.
I've been tinkering lately with time series, specifically utilizing the fabulous xts package ( a subset of zoo). I was trying to figure out a way to apply a function to each row in an xts object. Low and behold, apply.monthly.... (Just ?apply.monthly and look at the examples)
However, it didn't quite do what I needed. The custom function I had written wasn't vectorised. It took four variables, assumed each held one number, and applied some logic.
When I tried apply.monthly(x, myfunc(a,b,c,d)) it didn't work.
Rooky mistake - I failed to recognize the very way in which the data in R is held, one of the principles of programming in R - vectorization. Variables should hold vectors, and functions should be applied across the whole vector at once. But how?
I recoded the function to use the ifelse function, which IS vectorised.
All I had to do then was run the function over the variable inside the xts object I was interested in and hey presto we get a vector of meaningful results to use.
This underlying nature of the principles of design which is so heavily utilised (and utilised well) in R I feel is something that is worth rememvering.