Monthly Archives: October 2012

A quick introduction to ggplot()

October 5, 2012
By
A quick introduction to ggplot()

I gave a short talk today to the about ggplot. This what I presented. Additional resources at the bottom of this post

ggplot is an R package for data exploration and producing plots. It produces fantastic-looking graphics and allows one to slice and dice one’s data in many different ways.

Comparing with base...

Read more »

Style your R charts like the Economist, Tableau … or XKCD

October 5, 2012
By
Style your R charts like the Economist, Tableau … or XKCD

As we noted last month, the new Themes feature in ggplot2 helps you customize the design of R charts to your liking. Now, R user Jeffrey Arnold has built on this feature to create standardized themes to make R graphics looks like those from major publications and other software systems. You can use his ggthemes package to make your...

Read more »

How to read BSMAP methylation ratio files into R via methylKit

October 5, 2012
By

BSMAP is an aligner for bisulfite sequencing reads. It outputs aligned reads as well as methylation ratios per base (via methratio.py script). The methylation ratios can be read into R via methylKit package and regular methylKit analysis can ...

Read more »

DIY ZeroAccess GeoIP Plots

October 5, 2012
By
DIY ZeroAccess GeoIP Plots

Since F-Secure was #spiffy enough to provide us with GeoIP data for mapping the scope of the ZeroAccess botnet, I thought that some aspiring infosec data scientists might want to see how to use something besides Google Maps & Google Earth to view the data. If you look at the CSV file, it’s formatted as

Read more »

<-s and =s and assigns in R

October 5, 2012
By

# I think it worth going into how R uses uses arrows and equal signs as well as the "assign" command.# A single left arrow acts the same as a single equal sign.# Thus:x=4xy<-xy# This basically says take the value of x and assign it to y.  Inter...

Read more »

Marking time in R

October 5, 2012
By
Marking time in R

In a previous example, I showed how to find the onset of a single drumbeat, as well as the chord at an instant. This new example extends the method to detect the onset of several notes in a row, and demonstrates some interesting challenges involved in musical transcription. The general process is to read in

Read more »

Running motivation #An R amusement

October 5, 2012
By
Running motivation #An R amusement

Henry John-Alder told me once that in a marathon, twice as runners cross the line at 2h 59m than at 3h 00m. He pointed out that this anomaly in the distribution of finishers per minute (roughly normal shaped) is due … Continue reading

Read more »

Calculating distances (across matrices)

October 5, 2012
By
Calculating distances (across matrices)

This Gist is mostly for my future self, as a reminder of how to find distances between each row in two different matrices. To create a distance matrix from a single matrix, the function dist(), from the stats package is sufficient. There are times, ho...

Read more »

Permanent Portfolio – Simple Tools

October 4, 2012
By
Permanent Portfolio – Simple Tools

I have previously described and back-tested the Permanent Portfolio strategy based on the series of posts at the GestaltU blog. Today I want to show how we can improve the Permanent Portfolio strategy perfromance using following simple tools: Volatility targeting Risk allocation Tactical market filter First, let’s load the historical prices for the stocks(SPY), gold(GLD),

Read more »

RcppArmadillo 0.3.4.3

October 4, 2012
By

Another bug-fix release of Armadillo, now at version 3.4.3 whike the 3.4.* stabilizes, and with it a version 0.3.4.3 of RcppArmadillo, our wrapper for R and Armadillo. The new version is already on CRAN as of earlier today. Once again no R level or i...

Read more »