January 2007
M T W T F S S
« Dec   Feb »
1234567
891011121314
15161718192021
22232425262728
293031  

Speed up folder loading in mutt

Sometimes you have these little nuggets tucked away somewhere. Yesterday I found I could add the following line to my .muttrc and now it loads my huge mail folders in a flash!!

set header_cache=/home/<username>/.mutt_cache

It used to be so boring to see mutt loading a folder with over a thousand messages. Now, it takes no [...]

mutt colours

I just spiced up my mutt with colors. Used the basic color schemes from here and then changed it to suit my requirements. Looks cool!!

v.

Renaming variables in a dataframe

There is no direct command in R for renaming variables and that may make it less than obvious for some people. Of course, once you know, it is simple. The following command does the trick.

names(dataframe)[names(dataframe)=="oldvariablename"]<-”newvariablename”

 

VR

 

Technorati: GNU-R

Area under curve

There are various ways in which you can get R to calculate area under a curve. Some of these are explained in various posts on this thread. Ravi Varadhan wrote up the following function that uses trapezoidal rule for calculating area between a 45 degrees line and a curve. I used it to get gini [...]

Postscript graphics from R

Graphics made in R are best saved as postscript files if the files are to be used for printing. This can be done by wrapping your commands (for example, plot) in a postscript device, or by printing the plot to postscript after the plot has been created.

Method 1.

postscript(“filename”,width=x,height=y)

plot commands

[...]

Use reshape to tabulate

Package reshape is meant for aggregating, reshaping and tabulating data.Tabulation is done in two steps: melt and cast. Read help for these functions.

melt(sl1,id.var=,measure.var=”foo”)->sl2

This will create a dataframe sl2 which will have all the variablesin sl1 and “foo” being reorganised for casting later. See head(sl2) to see the form it takes.

List of variables in a dataframe

Function “names” gives list of columns/variables in a dataframe.

 

 

 

 

Technorati: R

R2HTML package

We can use R2HTML package to direct output of R to an html file.

Remember, R2HTML package is different from R2html command in the prettyR package.

 

The basic syntaxt of using it in an interactive R session is as follows.

 

library(R2HTML)

HTMLStart(filename = “~/test.html”, echo=TRUE)

..R commands [...]