KWIC, make me some hash!

IEEE Spectrum has a fascinating bio sketch of Hans Peter Luhn, inventor of the hashing and KWIC indexing algorithms.


This is Luhn’s legacy: He helped show that computers and computation weren’t just the province of mathematics, statistics, and logic but also of language, linguistics, and literature. In his day, this was a revolutionary way to think about machines.

Tip from the Geek Press.


R Tutorial: the non-linear equation solver

Need a numerical solution to simultaneous non-linear equations?  The nleqslv package is just what you’re looking for!  The coding required is minimal; just define the equations you want solved in a function, set some initial values, and let ‘er rip.

Here’s an example that uses the method of moments to estimate the parameters of a beta-binomial distribution.

Better than pretty

Pretty R is a syntax formatter for R, it generates highlighted and properly indented R code suitable for including in an HTML document.  Better yet, all the R keywords are linked back to an online reference manual at!  Check it out.

# multiple comparison with aov 
s <- read.table("dogFoodSales.txt",header=T)
# fit the ANOVA model and perform post hoc test (Tukey's HSD)
print( summary( smodel <- aov(sales ~ location, data=s) ) )
print( TukeyHSD(smodel,"location", ordered=TRUE) )
# check residuals for normality
# check for homogeneity of variance
print(bartlett.test(sales ~ location))
# just in case, verify with nonparametric test
print(kruskal.test(sales ~ location))

Tip from the R Bloggers.