Categories
Coding R

London UseR Group Talk – Slides

The inaugural London UseR event was a great success, with a lot of interesting people and a very constructive networking atmosphere!

I gave a (slightly disjointed) talk on concurrency and the bigmemory package in R (more on that later this year at UseR! 2009 in France).

The slides are here.

Categories
R

R User Group Meeting, London

On Tuesday March 31st, Mango Solutions are sponsoring the inaugural London R User Group Meeting. It will be a great opportunity to meet other R users and find out how people are using it. As the first one of its kind in London, I would expect a high level of interest. There will be a number of speakers presenting on various topics, using the UseR! panel format (short talks at around 15 minutes or so). I will be giving a short presentation, most likely following on from the real-time data integration work I presented on at UseR! 2008.

See this page for details on the event:

http://www.mango-solutions.com/events/UseRLondon.html

Categories
Coding Project Euler R

Project Euler Problem #28

Problem 28 on the Project Euler website asks what is the sum of both diagonals in a 1001×1001 clockwise spiral. This was an interesting one: the relationship between the numbers on the diagonals is easy to deduce, but expressing it succinctly in R took a little bit of tweaking. I’m sure it could be compressed even further.

[sourcecode lang=”r”]
spiral.size <- function(n) {
stopifnot(n %% 2 ==1)

if (n==1) {
return(1)
}
sum(cumsum(rep(2*seq(1,floor(n/2)), rep(4,floor(n/2))))+1)+1
}

spiral.size(1001)
[/sourcecode]