## Operating on files with R: copy and rename

Nowadays, routinary operations on files, such as renaming or copying, are performed with some mouse clicks. Sometimes, it is useful perform this operations in batch. Linux users perform this operations through the shell. Also Windows users can use the shell, … Continue reading →

Read more »

## Package-defined S4 generic covered by a base S3 generic in R packages

May 22, 2013
By

While developing our agop package I encountered some problems with calling S4 generic functions defined in the Matrix package, that were created from “base” S3 generics. I don’t know whether it’s an R bug (tested in R 2.15 and R…Read more ›

Read more »

## What happened to six million voters?

May 22, 2013
By

The recent elections in Pakistan on May 11 were a great success by all means. In spite of the threats for violence by Al-Qaeda and its local franchises in Pakistan against those who would vote, millions of Pakistanis indeed stepped out to vote for an elected government. The Election Commission of Pakistan (ECP) claimed a voter turnout of 60%....

Read more »

## My Prime Sieve – Homage to Yitan Zhang

May 22, 2013
By

# As a homage to Yitang Zhang who has proven a mind-bending property of Prime Pairs, I have written a prime Sieve to detect all of the prime numbers from 1 to N. # There might very well be a function in the base package that already does this. No...

Read more »

## Video: R, ProjectTemplate, RStudio and GitHub: Automate the boring bits and get on with the fun stuff

May 22, 2013
By

This post shares the video from the talk presented on 15th May 2013 by Dr Kendra Vant on ProjectTemplate, github and Rstudio at Melbourne R Users. Overview: Want to minimise the drudge work of data prep? Get started with test … Continue reading →

Read more »

## Analytical and simulation-based power analyses for mixed-design ANOVAs

May 21, 2013
By

In this post I show some R-examples on how to perform power analyses for mixed-design ANOVAs. The first example is analytical—and adapted from formulas used in G*Power (Faul et al., 2007), and the second example is a Monte Carlo simulation. Read more

Read more »

## Analytical and simulation-based power analyses for mixed-design ANOVAs

May 21, 2013
By

In this post I show some R-examples on how to perform power analyses for mixed-design ANOVAs. The first example is analytical — adapted from formulas used in G*Power (Faul et al., 2007), and the second example is a Monte Carlo simulation. The source code is embedded at the end of this post. Both functions require a dataframe, containing the parameters that will be used in...

Read more »

## Get your questions answered about Open Data

May 21, 2013
By

The OpenData StackExchange site has just launched in beta, and looks to be a great resource for open data sources. Like StackOverflow for programming and CrossValidated for statistics, OpenData is is a question and answer site for developers and researchers interested in open data. There's no R tag yet (though that would be nice for data sources specifically compatible...

Read more »

## Getting to the point – an alternative to the bezier arrow

May 21, 2013
By

An alternative bezier arrow to the regular grid-bezier. Apart from a cool gradient it has the advantages of: exact width, exact start/end points and axis...

Read more »

## Spatial correlograms in R: a mini overview

May 21, 2013
By

Spatial correlograms are great to examine patterns of spatial autocorrelation in your data or model residuals. They show how correlated are pairs of spatial observations when you increase the distance (lag) between them - they are plots of some index…Read more →

Read more »

## Pivot Tables for R: Try sqldf

May 21, 2013
By

Pivot tables are a a growing staple for analysis in excel yet they remain limited to the functionality which Microsoft has chosen to include. Typical operations are the inclusion of filters, choice over rows, columns, and maths operations. In R … Continue reading →

Read more »

## R Quick Tip: Shutdown Windows after Script Has Finished

May 21, 2013
By

Quite often I have long procedures running and want to do this over night. However, my computer would still be running all night after the script has finished. This is easily circumvented by the following lines that I put at the end of such a script:# set working dir# setwd("C:/Users/Kay/Desktop")# long procedure:for(i in 1:1e+5) {cat(i); cat("\n..................\n")}d # save...

Read more »

## Package party: Conditional Inference Trees

May 21, 2013
By

I am going to be using the party package for one of my projects, so I spent some time today familiarising myself with it. The details of the package are described in Hothorn, T., Hornik, K., & Zeileis, A. (1999). “party: A Laboratory for Recursive Partytioning” which is available from CRAN. The main workhorse of

Read more »

## Slide: one function for lag/lead variables in data frames, including time-series cross-sectional data

May 21, 2013
By

I often want to quickly create a lag or lead variable in an R data frame. Sometimes I also want to create the lag or lead variable for different groups in a data frame, for example, if I want to lag GDP for each country in a data frame. I've found the various R methods for doing this hard...

Read more »

## An R debugging example

May 21, 2013
By

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 The post An...

Read more »

## Geolocate IP addresses in R

May 20, 2013
By

This R function uses the free freegeoip.net geocoding service to resolve an IP address (or a vector of them) into country, region, city, zip, latitude, longitude, area and metro codes. Continue reading →

Read more »

## R programming challenge: Escape the zombie horde

May 20, 2013
By

So when the world is taken over by a Zombie horde, you're going to want to figure out a way to get the human population to safety. This R script by econometrician Francis Smart won't help you do that exactly, but given a list of waypoints to navigate through zombie-infested lands to a safe house, it will tell you...

Read more »

## Solving Multiple Supplier Selection Problem using R and LP Solve

May 20, 2013
By

(This article was first published on Enterprise Software Doesn't Have to Suck, and kindly contributed to R-bloggers) To leave a comment for the author, please follow the link and comment on their blog: Enterprise Software Doesn't Have to Suck. R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs,...

Read more »

## Non-Verbal Reasoning Test – Concerto

May 20, 2013
By

I have just released my first complete test of non-verbal problem solving skills.  It is run on Concerto (an R-based application development platform targeted at primarily test developers)  Try it out by following the link below.Non-Verbal Re...

Read more »

## R 3.0.1 is released

May 20, 2013
By

R 3.0.1 (codename “Good Sport”) was released last week. As mentioned earlier by David, this version improves serialization performance with big objects, improves reliability for parallel programming and fixes a few minor bugs. Upgrading to R 3.0.1 You can download …Read more »

Read more »

## R/Finance 2013 slides

May 20, 2013
By

I have just returned from the R/Finance conference and want to share with you my slides and examples. The Cluster Risk Parity portfolio allocation method is an example of Cluster Portfolio Allocation methods that focuses on diversification or more specifically diversification of your risk bets. (i.e. portfolio that distributes risk equally both within clusters and

Read more »

## More on Chutes & Ladders

May 20, 2013
By

Matt Maenner asked about the sawtooth pattern in the figure in my last post on Chutes & Ladders. Damn you, Matt! I thought I was done with this. Don’t feed my obsession. My response was that if the game ends early, it’s even more likely that it’ll be the kid who went first who won.

Read more »

## Model fitting exam problem

May 20, 2013
By

Recently I have run an exam where the following question had risen many problems for students (here I give its shortened formulation). You are given the data generating process y = 10x + e, where e is error term. Fit linear regression using lm, ne...

Read more »

## qdap 0.2.2 released

May 20, 2013
By

I’m very pleased to announce the release of qdap 0.2.2 This is the third installment of the qdap package available at CRAN. The qdap package automates many of the tasks associated with quantitative discourse analysis of transcripts containing discourse, including … Continue reading →

Read more »

## Implied alpha and minimum variance

May 20, 2013
By

Under the covers of strange bedfellows. Previously The idea of implied alpha was introduced in “Implied alpha — almost wordless”. In a comment to that post Jeff noticed that the optimal portfolio given for the example is ever so close to the minimum variance portfolio.  That is because there is a problem with the example … Continue reading...

Read more »

## analyze the new york city housing and vacancy survey (nychvs) with r

May 19, 2013
By

for those interested in the real estate and rental markets of the big apple, the census bureau's nyc housing and vacancy survey might be your key to the city.  if you care about how many new york residents live more than one person per room (a lot...

Read more »

## When Does the Kinetic Theory of Gases Fail? Examining its Postulates with Assistance from Simple Linear Regression in R

$When Does the Kinetic Theory of Gases Fail? Examining its Postulates with Assistance from Simple Linear Regression in R$

Introduction The Ideal Gas Law, , is a very simple yet useful relationship that describes the behaviours of many gases pretty well in many situations.  It is “Ideal” because it makes some assumptions about gas particles that make the math and the physics easy to work with; in fact, the simplicity that arises from these

Read more »

## Playing cards in Vegas?

May 19, 2013
By

In a previous post, a few weeks ago, I mentioned that I will be in Las Vegas by the end of July. And I took the opportunity to write a post on roulette(s). Since some colleagues told me I should take some time to play poker there, I guess I have to understand how to play poker… so I...

Read more »

## More tide prediction with R

May 19, 2013
By

In the previous post I outlined how to query the XTide software with R and parse the results into a handy-dandy data frame. The biggest hurdle with that method is getting XTide up and running on your computer. The code outlined here works entirely within R, so you don’t need XTide installed on your computer.

Read more »