I love using tikzDevice. When preparing LaTeX documents I switched to prepare all graphs in GNU R and then port them to TeX using tikzDevice. Recently I have moved to GNU R 3.0.0 and was shocked to find that this package is no longer available on CRAN.
R snippets
A collection of short R code samples I find reusable and interesting.
Tuesday, April 30, 2013
Tuesday, April 2, 2013
Estimating continuous piecewise linear regression
When talking about smoothing splines a simple point to start with is a continuous piecewise linear regression with fixed knots. I did not find any simple example showing how to estimate the it in GNU R so I have created a little snippet that does the job.
Saturday, March 16, 2013
GNU R loop speed comparison
Recently I had several discussions about using for loops in GNU R and how they compare to *apply family in terms of speed. I have not seen a direct benchmark comparing them so I decided to execute one (warning: some of the code presented today takes long time to execute).
Monday, March 11, 2013
Hexadecimal literals in GNU R
Recently I have used hexadecimal numbers in GNU R. The way they are parsed surprised me and is inconsistent with Java. As R Language Definition pdf only briefly mentions hexadecimal numbers here is what I have found.
Tuesday, March 5, 2013
Times per second benchmark
In GNU R the simplest way to measure execution time of a piece code is to use system.time. However, sometimes I want to find out how many times some function can be executed in one second. This is especially useful when we want to compare functions that have significantly different execution speed.
Friday, January 4, 2013
Solving 9-puzzle with GNU R
During holiday break I have decided to solve 9-puzzle, which is 3x3 variant of a well known 15-puzzle. The solution has proven to be a nice application of igraph package. Warning: this time the code takes a bit more tame than usual in my posts to execute.
Wednesday, December 26, 2012
Wrapper functions in GNU R
Recently I have been working with GNU R optimization routines a lot. Function optim has a nice trace option that allows to monitor optimization progress. Another standard function optimize has no such feature but it is possible to add outside tracking to it.
Subscribe to:
Posts (Atom)