Tag Archive for: Tao Te Programming

The TaoTeProgramming R package

29 Jun 2014
2014/06/29

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 CRAN.

The sea is just flat hills

sea51hills5 And they are both just smooth mountains.

Read more →

An xts R Inferno-ism

07 Feb 2014
2014/02/07

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 <- xts(cbind(a=1:4, b=11:14, c=21:24), order=Sys.Date() + 1:4)

which looks like: Read more →

Bricks not monoliths

06 Feb 2013
2013/02/06

Chapter 32 of Tao Te Programming advises you to make bricks instead of monoliths.  Here is an example. The example is written with the syntax of R and is a data analysis, but the principle is valid no matter what language you use or what your task is.

Monolith

Here is an outline of a function  reminiscent of many novice attempts:

monolith <-
function (data, col="blue", pch=21) 
{
        # transform data
        # fit model to data
        # plot data, uses 'col' and 'pch'
        # get desired model results
        # return desired model results
}

Each of these comment lines may be many lines of code so that the whole function runs to pages. Read more →

© Copyright - Burns Statistics