Use IUCN API with R & XPath

June 28, 2012
By
Use IUCN API with R & XPath

Thanks to a posting on R-sig-eco mailing list I learned of the IUCN-API. Here's a simple example for what can be done with it (output as pdf is HERE):require(XML)require(maptools)require(jpeg)input = "panthera-uncia"h <- htmlParse(paste("http://api....

Read more »

Big Data Generalized Linear Models with Revolution R Enterprise

June 28, 2012
By
Big Data Generalized Linear Models with Revolution R Enterprise

R''s glm function for generalized linear modeling is very powerful and flexible: it supports all of the standard model types (binomial/logistic, Gamma, Poisson, etc.) and in fact you can fit any distribution in the exponential family (with the family argument). But if you want to use it on a data set with millions or rows, and especially with more...

Read more »

Preparing Spectrum to import into "ChemoSpec"

June 28, 2012
By
Preparing Spectrum to import into "ChemoSpec"

In this video I show I to prepare a spectrum to import later into ChemoSpec:The software I use gives the option to export the spectrum as a TXT file.This file is open with Excel and saved as CSV, to import later with others into ChemoSpec.

Read more »

Updating R but keeping your installed packages

June 28, 2012
By

This is probably an issue that has been addressed by many blog posts (including these ones: and ), and can be deduced from R Installation and Administration manual. However, I will post it here for future reference. The problem is that w...

Read more »

Two tips: adding title for graph with multiple plots; add significance asterix onto a boxplot

June 28, 2012
By
Two tips: adding title for graph with multiple plots; add significance asterix onto a boxplot

I've not added tips for a while. Here is it for today:1. How to add title for graph with multiple plots?par(mfrow=c(1,2),oma = c(0, 0, 2, 0))plot(1:10,  main="Plot 1")plot(1:100,  main="Plot 2")mtext("Title for Two Plots", outer = TRUE, cex =...

Read more »

When SAP HANA met R – Bring home your graphics

When SAP HANA met R – Bring home your graphics

A couple of days ago, I started to think about SAP HANA and R on Amazon Web Services...as far as I know, graphics can't get generated using this kind of integration because the graphic will get generated on the server and could not make the trip back i...

Read more »

Reminder: Next Kölner R User Meeting 6 July 2012

June 27, 2012
By
Reminder: Next Kölner R User Meeting 6 July 2012

This post is a quick reminder that the next Cologne R user group meeting is only one week away. We will meet on 6 July 2012. The meeting will kick off at 18:00 with three short talks at the Institute of Sociology and will continue, even more informal, ...

Read more »

How do I Create the Identity Matrix in R?

June 27, 2012
By
How do I Create the Identity Matrix in R?

I googled for this once upon a time and nothing came up. Hopefully this saves someone ten minutes of digging about in the documentation. You make identity matrices with the keyword diag, and the number of dimensions in parentheses. > diag(3) [,...

Read more »

Orbitz and the Macs: Signals, not segmentation

June 27, 2012
By

By now you've probably heard about the fact that Orbitz users accessing the site via Macs are seeing more expensive hotel options when they search. But it seems worth clearing up a couple of fallacies. First, it's not as if the same hotel room is being offered at a higher prices to Mac users. (So no, using Windows to...

Read more »

Sleep – Part II

June 27, 2012
By
Sleep – Part II

Still gettin' it? I'm off to Montreal for Jazzfest.

Read more »

PluginR in mods.tiki.org updated

June 27, 2012
By
PluginR in mods.tiki.org updated

PluginR has been updated in mods.tiki.org. So what? Do I need to update my PluginR? How can I do it? PluginR resides in a subversion (svn) repository in sourceforge.net. Files can be fetched at any time by anyone using svn (see details in http://de...

Read more »

Access data quickly and easily: data.table package

June 27, 2012
By

This article gives a brief overview of the data.table package written by M. Dowle, T. Short, S. Lianoglou. A data.table is an extension of a data.frame created to reduce the working time of the user in two ways programming time … Continue reading →

Read more »

Effect of sample size on the accuracy of Cohen’s d estimates (95 % CI)

June 27, 2012
By
Effect of sample size on the accuracy of Cohen’s d estimates (95 % CI)

When talking about confidence intervals, Jacob Cohen famously said: “I suspect that the main reason they are not reported is that they are so embarrassingly large!” (Cohen, 1994). In this post I'll take a look at the relationship between the 95 % CI for Cohen's d and it's corresponding sample size.

Read more »

Solving Big Problems with Oracle R Enterprise, Part II

June 27, 2012
By
Solving Big Problems with Oracle R Enterprise, Part II

Part II – Solving Big Problems with Oracle R Enterprise In the first post in this series (see https://blogs.oracle.com/R/entry/solving_big_problems_with_oracle), we showed how you can use R to perform historical rate of return calculations against investment data sourced from a spreadsheet.  We demonstrated the calculations against sample data for a small set of accounts.  While this worked...

Read more »

Factor Attribution 2

June 26, 2012
By
Factor Attribution 2

I want to continue with Factor Attribution theme that I presented in the Factor Attribution post. I have re-organized the code logic into the following 4 functions: factor.rolling.regression – Factor Attribution over given rolling window factor.rolling.regression.detail.plot – detail time-series plot and histogram for each factor factor.rolling.regression.style.plot – historical style plot for selected 2 factors factor.rolling.regression.bt.plot

Read more »

Figuring an exchange rate for sports scores

June 26, 2012
By

While the US's Major League Soccer is using advanced analytics to analyze ball movement and improve team composition, they might want to think about a smaller, but possibly more impactful, goal for analytics. Like, how to explain to an American audience what a 1-2 game means to a basketball or baseball fan not familiar with scoring in the beautiful...

Read more »

Blog with R Markdown and tumblr: Part II

June 26, 2012
By
Blog with R Markdown and tumblr: Part II

In Part I of this series I described how to set up your tumblr blog so that you can create posts like those on the example site R Markdown Blog. Now I’ll describe how you can actually create such posts. I’ll be using the RStudio IDE for the desktop in all the steps below,...

Read more »

Crazy RUT in Academic Context Why Trend is Not Your Friend

June 26, 2012
By
Crazy RUT in Academic Context Why Trend is Not Your Friend

In response to Where are the Fat Tails?, reader vonjd very helpfully referred me to this paper The Trend is Not Your Friend! Why Empirical Timing Success is Determined by the Underlying’s Price Characteristics and Market Efficiency is Irrelevant by P...

Read more »

reproducible documents/analytics in R: the knitr package

June 26, 2012
By
reproducible documents/analytics in R: the knitr package

When I am working in new institutions and I am asking: “Do you have a document management system?” I often get the answer:”Yap, we are using folders” … OKAY. Making analysis, developing applications and keeping an eye on code, data and applications make this even harder as it has to be. Of course not many

Read more »

Workshop on Structural Equation Models

June 26, 2012
By
Workshop on Structural Equation Models

The Ted Rogers School of Management at Ryerson University is offering a one-day, hands–on workshop on Structural Equation Modelling. The workshop focuses on SEM theory and applications using R and Amos. Instructors: Professor Richard Michon and Christine Buske When: July 11, 2012 (8:30 to 3:30 pm) Where: TRS...

Read more »

Grouped means (again)

June 26, 2012
By
Grouped means (again)

So, the post I did yesterday on aggregate seemed to go down well. One of the comments suggested I add an example. Other comments had other useful hints which I thought I’d pass on more formally. So here goes… The mtcars dataset in base has data on various aspects of cars – miles per gallon,

Read more »

How to Convert Rugby into Football/Soccer Scores

June 26, 2012
By
How to Convert Rugby into Football/Soccer Scores

Following the Irish rugby team’s humiliating 60-0 defeat to New Zealand, an interesting question was posed on Twitter: what does a 60-0 result convert to in football/soccer? Intrigued, I decided to gather some data from both the English premier league (this season, more data collected and future blog posts to come!) and the equivalent English

Read more »

Shading regions of the normal: The Stanine scale

June 26, 2012
By
Shading regions of the normal: The Stanine scale

For the presentation of norm values, often stanines are used (standard nine). These values mark a person’s relativ position in comparison to the sample or to norm values. According to Wikipedia: The underlying basis for obtaining stanines is that a normal distribution is divided into nine intervals, each of which has a width of 0.5

Read more »

Bayesian Nonparametrics in R

June 25, 2012
By
Bayesian Nonparametrics in R

On July 25th, I’ll be presenting at the Seattle R Meetup about implementing Bayesian nonparametrics in R. If you’re not sure what Bayesian nonparametric methods are, they’re a family of methods that allow you to fit traditional statistical models, such as mixture models or latent factor models, without having to fully specify the number of

Read more »

Strategy Diversification in R – follow up

June 25, 2012
By
Strategy Diversification in R – follow up

The strategies used in Strategy Diversification in R were labeled as Strategy1 and Strategy2. Strategy1 Indicator: 52 week Simple Moving Average Entry Rule: Buy 1000 shares when price crosses and closes above 52 week Simple Moving Average Exit Rule: Exit all positions when prices crosses and closes below 52 week Simple Moving Average Classification: Long … Continue reading...

Read more »

Rcpp 0.9.12

June 25, 2012
By

A bug-fix release 0.9.12 of Rcpp arrived earlier today on CRAN and is now in Debian too. This fixes a minor snafu with the Rcpp::Enviroment constructor following a minor change made for 0.9.11. It also reduces the number of unit tests running by de...

Read more »

Wordcloud of the Arizona et al. v. United States opinion

June 25, 2012
By
Wordcloud of the Arizona et al. v. United States opinion

Here’s one purely for fun – a wordcloud built from the Supreme Court’s opinion on Arizona et al. v United States.  Word clouds, though certainly not the most scientific of visualization techniques, are often engaging and “fun” ways to lead…Read more ›

Read more »

New R User Groups in Ankara, Toronto

June 25, 2012
By

Two new local R user groups to report this week. In Turkey, the Ankara R Users Group has just started up. No meetings are scheduled yet, so be sure to suggest a meeting time/location when you sign up. The Toronto-based R Matlab Users group focuses on financial services applications. Created by Bryan Downing (who also produces the QuantLabs blog),...

Read more »

Olive Oil NIR/VIS Spectra – 001 (ChemSpec)

June 25, 2012
By
Olive Oil NIR/VIS Spectra – 001 (ChemSpec)

I continue with the practicing with ChemSpec, and this time I import seven spectra of olive oil. This time I have been more careful and I have the frequency column as numeric form the CSV file. Once I have the spectra (with and offset):Take in account ...

Read more »