Overlay of design matrices in genetic analysis

October 12, 2012
By
Overlay of design matrices in genetic analysis

I’ve ignored my quantitative geneticist side of things for a while (at least in this blog) so this time I’ll cover some code I was exchanging with a couple of colleagues who work for other organizations. It is common to … Continue reading →

Read more »

Using cairographics with ggsave()

October 12, 2012
By
Using cairographics with ggsave()

Whenever possible, I try to save R graphic output in a vector format, typically pdf(). I also like to use the handy ggsave() function to do so, as it streamlines the process, and makes it easy to be consistent across formats. However, at times it is n...

Read more »

Loading SPSS (.sav) into Stata

October 11, 2012
By

Most statistical softwares nowadays are able to convert their files to a wide range of other packages. Perhaps it is the reason for the discontinuity of old converter bundles like SAS Transport and DBMS. Interesting, however, Stata, a quite popular statistical package, still lack built-in support for exporting and importing files among concurrent softwares like

Read more »

Download Stock Price Online with R

October 11, 2012
By
Download Stock Price Online with R

Read more »

Revolution Newsletter: September/October 2012

October 11, 2012
By

The most recent edition of the Revolution Newsletter is out. The news section is below, and you can read the full September/October edition (with highlights from this blog and community events) online. You can subscribe to the Revolution Newsletter to get it monthly via email. New R Courses Announced: Two new courses presented by Bob Muenchen (author of R...

Read more »

Random Name Generator in R

October 11, 2012
By

Just for the heck of it, let's recreate my Reality TV Show Name Generator in R. This isn't really the sort of thing you'd normally do in R, but we can try out a bunch of different functions this way: random integers/sampling, concatenation, sorting, an...

Read more »

Pilot Study: Small Town Land Surface Temperature

October 11, 2012
By
Pilot Study: Small Town Land Surface Temperature

Introduction Zhang and Imhoff (2010)  pdf here utilized NLCD impervious surface area (ISA), Olson biomes, and MODIS Land Surface temperature (LST) to estimate the magnitude of UHI in large cities across the US.  Peng  employed a   similar approach in studying 419 large cities ( population greater than 1m ) around world. Peng’s work suggests a limit

Read more »

From holey polygons to convex hulls

October 11, 2012
By
From holey polygons to convex hulls

I only rarely have the occasion to need the convex hull of a set of points, but I love chull(), so I’d like to share an example of how to use it. This Gist also offers a pretty straightforward application of the Split-Apply-Combine strategy (see...

Read more »

Curved arrows in R

October 10, 2012
By
Curved arrows in R

I briefly investigated how to draw curved arrows in R. Here’s a small piece of the figure that I ultimately created: A google search for “curved arrows in R” revealed three options: curvedarrow in the diagram package The internal function igraph.Arrows within the igraph package (mentioned by Gabor Csardi in R help) Using xspline for

Read more »

Know Your Dataset: Specifying colClasses to load up an ffdf

October 10, 2012
By
Know Your Dataset: Specifying colClasses to load up an ffdf

When I finally figured out how to successfully use the ff package to load data into R, I was apparently working with relatively pain free data to load up through read.csv.ffdf (see my previous post).  Just this past Sunday, I … Continue reading →

Read more »

analyze the current population survey (cps) annual social and economic supplement (asec) with r

October 10, 2012
By

the annual march cps-asec has been supplying the statistics for the census bureau's report on income, poverty, and health insurance coverage since 1948.  wow.  the us census bureau and the bureau of labor statistics (bls) tag-team on this one...

Read more »

R amongst most popular languages, according to GitHub/StackOverflow data

October 10, 2012
By
R amongst most popular languages, according to GitHub/StackOverflow data

Data Scientist Drew Conway tackles the problem of deciding which programming languages are the most popular in an interesting way: by comparing the number of projects tagged in GitHub with each language, and the number of questions in StackOverflow about the language. The former is a measure of how often a language is used (though, mainly for open source...

Read more »

2012-6 Working with the gridSVG Coordinate System

October 10, 2012
By

The gridSVG package exports grid images to an SVG format for viewing on the web. This article describes new features in gridSVG that allow grid coordinate system information to be exported along with the image. This allows the SVG image … Continue reading →

Read more »

What lens should I buy next ?; Analysing and graphing a Digikam database using R

October 10, 2012
By

I use the Open Source photo management Software Digikam (along with other tools such as Gimp and DarkTable).  I obviously need very little encouragement to combine my geeky hobbies, so I quickly tried to interrogate Digikam with R, which is easy, ...

Read more »

Summarizing Circular Data in R: Aspect Angle

October 10, 2012
By
Summarizing Circular Data in R: Aspect Angle

The orientation of terrain surface (aspect) can have dramatic effects on landscape-scale variation in soil temperature and moisture. Summarizing aspect angle is complicated by the fact that sampled values are measured on a circular scale. The circular ...

Read more »

Simple marimekko/mosaic plots

October 10, 2012
By
Simple marimekko/mosaic plots

I don’t really care for the name “marimekko” or “mosaic,” but I do like this type of plot as a means of illustrating proportions in nested categorical data, or as an alternative to the parallel time series plots discussed...

Read more »

S&P 500 sector strengths

October 10, 2012
By
S&P 500 sector strengths

Which sectors are coherent, and which aren’t? Previously The post “S&P 500 correlations up to date” looked at rolling mean correlations among stocks.  In particular it looked at rolling mean correlations of stocks within sectors. Of importance to this post is that the sectors used are taken from Wikipedia. Relative correlations The thought is that … Continue reading...

Read more »

Review: Kölner R Meeting 5 October 2012

October 10, 2012
By
Review: Kölner R Meeting 5 October 2012

The third Cologne R user meeting took place last Friday, 5 October 2012, at the Institute of Sociology. The evening was sponsored by Revolution Analytics, who provided funding which went towards the Kölner R user group Meetup page. We had a good tur...

Read more »

Exploring phylogenetic tree balance metrics

October 10, 2012
By
Exploring phylogenetic tree balance metrics

I need to simulate balanced and unbalanced phylogenetic trees for some research I am doing. In order to do this, I do rejection sampling: simulate a tree -> measure tree shape -> reject if not balanced or unbalanced enough. But what is enough? We ne...

Read more »

Making Color Ramps in Matlab

October 9, 2012
By

When visualizing an array of data in a heatmap, a good color map makes a world of difference.Thanks to my work in 'omics (i.e. transcriptomics - microarrays and RNASeq) I've looked at a lot of heatmaps over the past couple of years, and generated quite...

Read more »

A brief script on Geographical data analysis in R

A brief script on Geographical data analysis in R

I saw this post and I decided to replicated that good example but with data closer to me, particulary data of my country. So, I've got the shape data of the capital of my country (You can download the data from here). The data comes from the 2002 CENSO...

Read more »

Permanent Portfolio – Transaction Cost and better Risk Parity

October 9, 2012
By
Permanent Portfolio – Transaction Cost and better Risk Parity

I want to address comments that were asked in my last post, Permanent Portfolio – Simple Tools, about Permanent Portfolio strategy. Specifically: The impact of transaction costs on the perfromance and Create a modified version of risk allocation portfolio that distributes weights across 3 asset classes: stocks(SPY), gold(GLD), and treasuries(TLT), and only invests into cash(SHY)

Read more »

Revised graph for BAC 1% cash rewards

October 9, 2012
By
Revised graph for BAC 1% cash rewards

Thanks to Anthony Damico who alerted me to an error in the Bank of America's 1% cash rewards figure in my last post. The plot shows the true reward percentage as a function of purchase amount. A key "feature" of the BoA reward program is that the full 1% is only awarded for purchases in

Read more »

Age-Period-Cohort models and the decline of violence

October 9, 2012
By
Age-Period-Cohort models and the decline of violence

Ever since the end of the Mexican Revolution and the Cristero War violence in Mexico inched down in fits and starts from a high of about 60 homicides per 100,000 people to its lowest level sometime during the middle of the last decade (there's some uncertainty about the number of homicides in...

Read more »

R User Group Sponsorship: Applications open for 2013

October 9, 2012
By

Here at Revolution Analytics, we're proud to have been a part of fostering local user groups for R users around the world. Last year we sponsored more than 40 groups, with representation from every continent around the world. And we're thrilled to see the continued growth in user groups: this time last year there about 50 R user groups;...

Read more »

Git Error when pushing with a large file

October 9, 2012
By

Quick Note: I had an error recently where RStudio nor EGit nor the command line would push my repo to github.  I can't remember the exact error, although after some googling I found this SO answer that solved it git config http.postBuffer 52428800...

Read more »

Error Handling in R

October 9, 2012
By
Error Handling in R

It’s often the case that I want to write an R script that loops over multiple datasets, or different subsets of a large dataset, running the same procedure over them: generating plots, or fitting a model, perhaps. I set the script running and turn to another task, only to come back later and find the Related posts:

Read more »

Debugging parameter mismatch across RAC database instances with R, dba_hist, and gv$parameter

October 9, 2012
By
Debugging parameter mismatch across RAC database instances with R, dba_hist, and gv$parameter

Did you find this post useful?  Does your organization need Oracle services?  We can help.   Much of this morning went into investigating strange ADDM reports on a two-node Oracle RAC database.  For some reason, there were statistically improbable differences…Read more ›

Read more »

Conditional Colors and Shapes in plot() with ifelse()

October 9, 2012
By
Conditional Colors and Shapes in plot() with ifelse()

Here’s an example of how to color your plot shapes and pch using an ifelse() statement. Ifelse() is handy as it creates an easy way to branch a function. The syntax is: ifelse(logical.condition, option1, option2). Meaning, if the logical condi...

Read more »