this week i

bought an easy-to-type domain name and then published instructions to analyze the brfss.

assisted some brazilians doing what i do best.

thought they banned corporeal punishment.

would like to thank the modern aviation industry for making this all possible.  if buildings skip the 13th floor, shouldn't airport terminals skip gate C4?

passed a few days in durban.

picnicked by the umgeni riverside.



crossed a few crosswalks where the car with its turn signal on stopped and waited for me to finish crossing (you know, so they don't run me over). the cars behind invariably honk.  reassuring.

love the visit, but tire of life behind electrified fences.  tropical kabul.

hired a taxi for a few hours.  apparently taxis come standard with tour guides in kzn.  anyway, they brought me to watch a staged traditional zulu dance and um well i refused like any sane person should.

asked to drive around the countryside and just get lost.  so we did.





think caramel might be the secret ingredient in coca-cola and that south africa is a boring name for not a boring country.  also..

relieved the zipper's parallel and not perpendicular to his belt

that's it.  competition over, people.  world's best dad right there.  stop making any more mugs.

passed three more caffeinated workdays in the perfect weather, fortress-level security of a johannesburg guest house.

read the r inferno all the way through.

there are some functions that are generic.  examples include print, plot, summary.  these functions look at the class attribute of their first argument.  if that argument does have a class attribute, then the generic function looks for a method of the generic function that matches the class of the argument.  if such a match exists, then the method function is used.  if there is no matching method or if the argument does not have a class, then the default method is used.

the `[[` operator, which is basically synonymous with `$` on lists

the rules for argument matching in function calls..

    if a tag matches a formal argument exactly, then the two are bound.
   
    unmatched tags are partially matched to unmatched formal arguments.

    an error occurs if any tag partially matches more than one formal argument not already bound.

    (positional matching) unmatched formal arguments are bound to unnamed (no tag) arguments in the call, based on the order in the call and of the formal arguments.

    if `...` is among the formal arguments, any formal arguments after `...` are only matched exactly.

    if `...` is among the formal arguments, any unmatched arguments in the call, tagged or not, are taken up by the `...` formal argument.

    an error occurs if any supplied arguments in the call are unmatched.


the space bar is an excellent resource
   
the apply family tends to have arguments that are in all capitals, and hence unlikely to collide with arguments of other functions that tend to be in lower case.

the bquote function is generally the most useful - it is similar to substitute

the `:` operator is one of the few places in r where integers are produced
is.integer( 1:3 )
TRUE
is.integer( c( 1:3 , 4 ) )
FALSE
is.integer( c( 1:3 , 4:4 ) )
TRUE

my notes --

# how to find what the mean() function executes
mean
# how to find the code for the mean
getS3method( 'mean' , 'default' )
# how to find what specific functions will be run on different classes of objects
methods( 'mean' )

the distinction between (non-vectorized) max and (vectorized) parallel max -- sneaky.
max( 1:5 , 6:2 )
[1] 6
pmax( 1:5 , 6:2 )
[1] 6 5 4 4 5

the distinction between & and &&, | and || -- evaluate everything or just whatcha need.
if(TRUE || stop()) 4 else 5
[1] 4
if(TRUE && stop()) 4 else 5
Error:
if(FALSE || stop()) 4 else 5
Error:
if(FALSE && stop()) 4 else 5
[1] 5

to prevent returning c( 1 , 0 ) for zero-length data frames,
instead of 1:ncol( mtcars ) use seq_along( mtcars )
instead of 1:nrow( mtcars ) use seq_len( nrow( mtcars ) )

12/20