Monthly Archives: September 2015

On Lagrange Polynomials

September 30, 2015
By
On Lagrange Polynomials

Let’s take $n$ distinct points on the real line: Yay. We can now define the Lagrange Polynomials : Why am I making you look at this beauté? Turns out there’s some neat mathematical properties - namely in the subject of polynomial interpolation. That’s a fancy way of saying ‘fit a polynomial through certain points’ but we’ll get to that. Now, it’s...

Read more »

Understanding empirical Bayes estimation (using baseball statistics)

September 30, 2015
By
Understanding empirical Bayes estimation (using baseball statistics)

Which of these two proportions is higher: 4 out of 10, or 300 out of 1000? This sounds like a silly question. Obviously , which is greater than . But suppose you were a baseball recruiter, trying to decide which of two potential players is a better batter based on how many hits they get. One has achieved 4 hits...

Read more »

Playing with Leaflet (and Radar locations)

September 30, 2015
By
Playing with Leaflet (and Radar locations)

Yesterday, my friend Fleur did show me some interesting features of the leaflet package, in R. library(leaflet) In order to illustrate, consider locations of (fixed) radars, in several European countries. To get the data, use download.file("http://carte-gps-gratuite.fr/radars/zones-de-danger-destinator.zip","radar.zip") unzip("radar.zip")   ext_radar=function(nf){ radar=read.table(file=paste("destinator/",nf,sep=""), sep = ",", header = FALSE, stringsAsFactors = FALSE) radar$type <- sapply(radar$V3, function(x) {z=as.numeric(unlist(strsplit(x, " ")])); return(z)}) radar <-...

Read more »

#MonthOfJulia Day 25: Interfacing with Other Languages

September 30, 2015
By
#MonthOfJulia Day 25: Interfacing with Other Languages

Julia has native support for calling C and FORTRAN functions. There are also add on packages which provide interfaces to C++, R and Python. We'll have a brief look at the support for C and R here. Further details on these and the other supported languages can be found on github. Why would you want The post

Read more »

Combining Choropleth Maps and Reference Maps in R

September 30, 2015
By
Combining Choropleth Maps and Reference Maps in R

Recent updates to my mapping packages now make it easy to combine choropleth maps and reference maps in R. All you have to do is pass the parameter reference_map = TRUE to the existing functions. This should “just work”, regardless of which region you zoom in on or what data you display. The following table shows the affected functions and their The post

Read more »

For Some Definition of “Directly” and/or “Contort”

September 30, 2015
By
For Some Definition of “Directly” and/or “Contort”

Junk Charts did a post on Don’t pick your tool before having your design and made a claim that this: “cannot be produced directly from a tool (without contorting your body in various painful locations)”. I beg to differ. With R & ggplot2, I get to both pick my tool and design at the same

Read more »

Hacking The New Lahman Package 4.0-1 with R-Studio

September 30, 2015
By

The developers of the Lahman package for R have recently updated the package to include 2014 MLB stats! For those not familiar, this R package recreates Sean Lahman’s Baseball Database into a quick and handy little R package. I’ve written on the Lahman package before, and even suggested adding a few advanced statistics to the

Read more »

Rebuilding Map Example With Apply Functions

September 30, 2015
By

Yesterday Hadley’s functional programming package purrr was published to CRAN. It is designed to bring convenient functional programming paradigma and add another data manipulation framework for R. “Where dplyr focusses on data frames, purrr focusses on vectors” – Hadley Wickham in a blogpost The core of the package consists of map functions, which operate similar to...

Read more »

Unbalanced Data Is a Problem? No, BALANCED Data Is Worse

September 29, 2015
By
Unbalanced Data Is a Problem? No, BALANCED Data Is Worse

Say we are doing classification analysis with classes labeled 0 through m-1. Let Ni be the number of observations in class i. There is much handwringing in the machine learning literature over situations in which there is a wide variation among the Ni. I will argue here, though, that the problem is much worse in … Continue reading...

Read more »

The Discrete Charm of the Fourier Transform

September 29, 2015
By
The Discrete Charm of the Fourier Transform

The other day, I picked up the latest copy of the CAS’ journal, Variance and skipped to the back where Leigh Halliwell had an article. I hope that I’m well on record as being one of his biggest fans, but if not, let me remedy that now. Leigh Halliwell has done really tremendous stuff. He’s mathematically sophisticated, but addresses...

Read more »

Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)