Using the reshape package in R for pivot-table-like functionality

A little more than a week ago, I wrote about creating pivot tables in Microsoft Excel and OpenOffice.org. I also mentioned that I would explain how to do similar calculations by using R. This post will explain how to achieve similar results in R by using the reshape package.

I had initially started experimenting with the reshape package several months ago when I was trying to figure out how to reshape data from wide to long formats. However, once I started experimenting with it, I realized I had misunderstood what the reshape package was designed to do. Now that I finally have a grasp of what can be done using the package, I thought I would share what I’ve found using a few examples.

Read More »

Posted in (all categories), Geekiness, Useless Knowledge | Tagged , , , , , , , , , , , | 2 Comments

Sometimes, I wish I could turn my editing eyes off

… but if I did, then I would probably miss out on some of the fun that Indian English has to offer.

Read More »

Posted in (all categories), Humor, India, Pictures | Tagged , , , , , , , | Leave a comment

Pivot Tables in Excel and OpenOffice.org Calc

One of the features I find useful in Excel is the ability to create “pivot” tables. Essentially pivot tables let you summarize big tables of data in different ways, using different variables to “pivot” your data around (hence the name, I guess). Pivot tables are most easily understood through an example, so here’s one done using Excel 2007, and the sort-of-equivalent “Data-Pilot” in OpenOffice.org Calc (OO.o Calc).

Read More »

Posted in (all categories), Geekiness, OpenOffice.org, Useless Knowledge | Tagged , , , , | Leave a comment

Getting data into R

When you first open R, you’re greeted with a screen similar to the following:

R version 2.10.0 (2009-10-26)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

>

I’ve been trying to encourage my students to use R for some of their work, but in the process, I sort of forgot that for most people, starting up a program and just being greeted with a command prompt might be somewhat intimidating. So after several of my students indicated that they had downloaded and installed R but had no idea what to do next, I thought I would write about some of the very basic ways to get started. I recognize that for some huge datasets, the suggestions here are not the best, but for me, and for most of my students, the datasets that we would be working with are actually quite small.

Read More »

Posted in (all categories), Geekiness, Useless Knowledge | Tagged , | Leave a comment

The awesomeness that is WordPress and child themes

After a long long long time, I decided to get back into some actual website experimentation. For a while, I was really lazy with my site design and settled on using the Atahualpa theme. This was a great be-lazy theme, but I noticed that while browsing other sites, it often became too obvious which sites were made using the theme and me, always wanting “my own thing” decided that it was time to get my hands at least a little bit dirty again.

Read More »

Posted in (all categories), CSS, Geekiness, Website | Tagged , , , , , | Leave a comment

R is like a giant calculator for grownups

One of the things that is interesting about R is how flexible it is. One of the fun things about it is how interactive it can be. While my examples so far have been a little bit more involved, it can be useful to spend some time just getting acquainted with how R performs basic calculations. In fact, I sometimes like to think of R as a giant calculator for grownups to play with. The following syntax snippets show how you can perform basic calculations with R. This is by no means complete, but it should provide a reasonable introduction to someone just getting started with R. (Experienced R users would find this TOTALLY useless….)

Read More »

Posted in (all categories), Geekiness, Useless Knowledge | Tagged , | Leave a comment

What some of the other people are doing….

I thought I’d take a break from my ego-centric rambling and share a little bit about what other people are doing….

Amy's in the news...

Amy's in the news...

Amy’s busy creating her own website, hosted at http://www.tnsms.org. No, it’s not about text messages from your Tamil Nadu mobile phone; it’s an abbreviation for “Tamil Nadu Socioeconomic Mobility Survey.” Just putting the site live ended up getting her a brief interview in the Times of India. (click on the picture to get a larger image.)


Read More »

Posted in (all categories), General News | Leave a comment

A little spark for presenting your data

For some reason, I’ve been obsessing over the presentation of data. (Either it is that I’ve just read all of Edward Tufte‘s books, or I’m just being a nerd. But I guess that those two things aren’t exactly exclusive….) Considering my obsession, you could imagine how I felt when one of my students stood up and made a presentation that included the following slides, along with the typical, “As you can see here, the production of rice has been decreasing. And as you can see in this chart, the production of wheat has been decreasing,” for slide after slide after slide.


If for some reason you’re not able to see the embedded slides, you can also view the slides in a new window.

Read More »

Posted in (all categories), Geekiness, OpenOffice.org, Useless Knowledge | Tagged , , , | 2 Comments

A Primer on Linking Disaster Risk Reduction with Development Efforts

I’m very happy to announce that the primer I wrote for the Advanced Centre for Enabling Disaster Risk Reduction is now available online.

Here’s the abstract:

When one surveys news reports today, mention of disasters seem to be commonplace. And, quite often, there is a lot of response to disasters. Aid agencies channel money or other forms of relief directly to communities who need it or to organizations who are better prepared to implement response work. Governments create plans to offer rehabilitation support, or find some other way to compensate those who are affected by disasters. Academicians write reports comparing one disaster to similar disasters, and theorize about what could have been done to minimize the impact of the disaster.

But where is the community in this post-disaster scenario? And what about the communities who have not suffered catastrophes? Are they safe? Is that enough? Is it appropriate to merely respond to disasters, or is there a better way to approach disaster risk reduction? And what does this mean for a development organization?

ACEDRR believes that there is simultaneously a positive and negative relationship between development and disasters. However, development efforts have incredible potential to contribute to disaster risk reduction and to help create a “culture of preparedness”. Development practitioners have a responsibility to be aware of this continuum and use it to guide their work and to build knowledge about disaster preparedness and prevention.

This primer is by no means a complete account of the relationship between disasters and development. However, it is hoped that this primer can serve as an introduction for practitioners to become more sensitized to the relationship, and that they use this awareness to change from working in what is mostly a reactive manner, to working in a proactive one. It is also hoped that this primer can lay a foundation for further discussions and research—not discussions and research designed around communities, but ones which include the community as an integral partner and as a stakeholder whose traditional wisdom might be able to help us with some of the more complicated issues we face in our rapidly modernizing world.

And, here’s the report itself.

[Cross-posted at ananda.mahto.info. Spread the link around!]

Posted in (all categories), (non) fiction, India | Tagged , , , | Leave a comment

13 years

On Saturday, Amy and I celebrated the 13-year anniversary of our “first date” by going to Kodaikanal for the day. Pretty fun, but nothing much to report, except for a few silly pictures:

Read More »

Posted in (all categories), 2657 Productions, DWAB, General News, Music | Tagged , , , | Leave a comment