Articles by vikasrawal

Using Emacs, Org-mode and R for Research Writing

May 13, 2014 | vikasrawal

This guide presents a toolkit for writing research papers and monographs using Emacs, Org-mode and R. Org-mode allows embedding statistical code in the document to generate results that can be revised and reproduced, integration of bibliographic references with a database, and consistent formatting without any manual tweaking using excellent support ... [Read more...]

Sustainability of water use in agriculture

March 9, 2014 | vikasrawal

AQUASTAT, developed and maintained by the Food and Agriculture Organization of the UN, is the global database that gives quantitative information on water resources and withdrawal of water for different uses. Agricultural water withdrawal is defined as follows: Annual quantity of self-supplied water withdrawn for irrigation, livestock and aquaculture purposes. ... [Read more...]


February 8, 2009 | vikasrawal

I discovered a new, very useful, R function yesterday: ave. This is what it does: “Subsets of ‘x[]‘ are averaged, where each subset consist of those observations with the same factor levels.” But interestingly, you can use any function other than average. The output of that function is set against ... [Read more...]


April 6, 2008 | vikasrawal

If a model is estimated using the following code: lm(y~x1+x2)-__p 1. bptest(p) does the Breuch Pagan test to formally check presence of heteroscedasticity. To use bptest, you will have to call lmtest library. 2. If the test is positive (low p value), you should see if ... [Read more...]

Working with ggplot, version 2

June 6, 2007 | vikasrawal

In my previous post on this issue, I had presented a code that made weighted boxplots and annotated them with boxplot statistics and the mean values. The problem with that code was that it printed these annotations right on the vertical axes of the boxplots. Also, a relatively minor problem ... [Read more...]

Reading data from microsoft access files in linux

March 28, 2007 | vikasrawal

Some of the Census 2001 data are in microsoft access files (having filename extensions .mdb). A microsoft access file can have several tables inside, each of which contains data. There is a software called mdbtools that can be used to read access files. The command mdb-tables can be used to see ... [Read more...]

simple.scatterplot: Two way distributions

March 21, 2007 | vikasrawal

John Verzani’s book has a title page that shows a scatterplot with histograms of x and y variables along the two axes. It is a very powerful way of looking at two distributions. The plot was generated through a function simple.scatterplot. The function is made available as part ... [Read more...]

Working with ggplot

February 24, 2007 | vikasrawal

Hadley Wickham’s ggplot is a very interesting package. It makes beautiful graphics, integrates well with some of the other packages to allow you to superimpose the plots of various types of estimates on plots of data. In particular, it uses colours very well. The default colour schemes are aesthetically ... [Read more...]

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)