Publications by Patrick Burns
A corner on convenient data analysis
Many people are of the opinion that R has a corner on convenient data analysis. That may or may not be true. But now R literally has a corner that makes data analysis more convenient. If you have a data frame or a matrix with a few columns, then you can use head and/or tail to make sure that it looks as you expect. However, the result is un...
1775 sym R (1416 sym/7 pcs)
The three-dots construct in R
There is a mechanism that allows variability in the arguments given to R functions. Technically it is ellipsis, but more commonly called “…”, dots, dot-dot-dot or three-dots. Basics The three-dots allows: an arbitrary number and variety of arguments passing arguments on to other functions Arbitrary arguments The two prime cases are the ...
4347 sym R (1047 sym/13 pcs)
R database interfaces
Several packages on CRAN provide (or relate to) interfaces between databases and R. Here is a summary, mostly in the words of the package descriptions. Remember that package names are case-sensitive. The packages that talk about being DBI-compliant are referring to the DBI package (see below in “Other SQL”). MySQL dbConnect: Provides a gr...
4467 sym Python (411 sym/1 pcs)
Plot ranges of data in R
How to control the limits of data values in R plots. R has multiple graphics engines. Here we will talk about the base graphics and the ggplot2 package. We’ll create a bit of data to use in the examples: one2ten <- 1:10 ggplot2 demands that you have a data frame: ggdat <- data.frame(first=one2ten, second=one2ten) Seriously exciting data, yes?...
3386 sym R (894 sym/13 pcs) 14 img
The options mechanism in R
Customization in R. Basics Several features benefit from being customizable — either because of personal taste or specifics of the environment. The way R implements this flexibility is through the options function. This both sets and reports options. For example, we can see the names of the options that are set by default: > names(options()...
3917 sym R (2681 sym/10 pcs)
On the acceptance of R
Some history and a prediction. Past A discussion broke out on the R-help mailing list in January 2006 about a technical report put out by the statistical computing group at UCLA. The report in question talked mainly about SAS, SPSS and Stata. It talked briefly — and not especially positively — about R. Someone accused it of damning R wi...
2304 sym R (24 sym/1 pcs)
R and social media
R is a piece of software, but it is also a community. Help community The most visible aspect of the R community is help. This is also the most useful to new users. The initial sense of cooperation with R was driven mainly by people helping each other. You don’t need to actively participate in order to benefit from the help venues — just w...
7205 sym R (68 sym/2 pcs)
Interview with a forced convert from Matlab to R
Here is an interview with Ron Hochreiter, Assistant Professor at WU Vienna University Economics and Business. In 25 words or less tell us what you do (using German words is cheating). I consider myself as a data scientist (teaching and research) with roots in Mathematical Programming, i.e. Optimization under Uncertainty (Stochastic Programming)....
4914 sym 4 img
Living it up with computational errors
How to have a better chance of a good outcome. Making mistakes There’s been a lot of talk recently about data analysis problems with spreadsheets. If you’ve not stuck your head out of your cave lately, then you can catch some of the discussion by doing an internet search for: Reinhart Rogoff There are several points at issue, but one thing ...
5664 sym R (300 sym/4 pcs)
An R debugging example
The steps taken to fix an R problem. Task To prepare for the Portfolio Probe blog post called “Implied alpha and minimum variance”, I tried to update a matrix of daily stock prices using a function I had written for the purpose. Error When I tried to do what I wanted, I got: > univclose130518 <- pp.updateclose(jjuc[,1:5]) done with: MMM ABT ...
5923 sym R (3759 sym/11 pcs)