Pretty printing e-mails in mutt

February 28, 2008 at 7:54 pm | In Uncategorized | 1 Comment

See updates and leave comment on the new blog here.

I have been looking for a good solution for pretty printing from
mutt. The best solution suggested is muttprint. The problem, however,
is that muttprint uses the latex system to print. I am not a latex
user and I do not want to install the entire latex system on my
machine just to print e-mails.

There are two other alternatives that I have come across: mp and
enscript.

Solution 1. mp

1) Install mp and mptools. On my ubuntu machine that is as simple as
/> apt-get install mp mptools

2) Add the following line to .muttrc

set print_command=”/usr/bin/mp -A4 -F -l -m -left 74 -right 74 | lpr -P printername”

I do not like the output of mp very much. It is somewhat stupid in
wrapping text across lines: it justifies the print on both sides but splits
the words wherever the number of characters hits the maximum
width.

Solution 2. enscript

enscript is insalled on most linux distribution by default.

Adding the following line to .muttrc sets mutt to print via enscript

set print_command=”enscript -Email –pretty-print -G -P printername “

The following line in .muttrc (instead of the previous one) will make
enscript print in landscape format and print in two columns.

set print_command=”enscript -Email –pretty-print -G2r -P postscript-color-pdf”

The problem with enscript is that it prints all the mail headers. Its
output is nicely formatted except for the fact that it prints all the
junk in the headers.

I do not yet know of any way of making either mutt pass only selected
headers to enscript or get enscript to skip some headers. My instinct
is that there may be some way of getting the mutt to do the job. I do
not yet know and would benefit if someone who drops by on this blog
has a solution to offer.

At the moment I am sticking to the first solution but I am looking for
a better way of using enscript.

V.

Heteroscedasticity

February 28, 2008 at 7:54 pm | In Linux | Leave a Comment

See updates and leave comment on the new blog here.

f 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 any transformation of the dependent variable helps you eliminate heteroscedasticity. Also check if the right hand side of the model is okay.

3. If 2 does not work, you can use the white’s heteroscedasticity-corrected covariance matrices to make inference. Package car has a function hccm that gives you the heteroscedasticity-corrected covariance matrix (there is a similar function in package sandwich also). coeftest(p,vcov=hccm(p)) will give you the results of the tests using this matrix. Use these results instead of summary(p).

library(lmtest)
library(car)
bptest(p)
coeftest(p,vcov=hccm(p))

Testing weblogger mode in emacs

February 24, 2008 at 4:23 pm | In Linux | Leave a Comment

I am increasingly using emacs for a lot of things that I do (heard
this before??).

* I use emacs with mutt to compose emails.
* I use orgmode as my organiser.
* I use ess for programming environment for R.
* and I have just started using weblogger for maintaining my blog
(This is a test blog entry being send from e-macs using weblogger mode).

I do not understand much of lisp, but I have been able to edit .emacs
to customise my emacs a little bit. I am sure it can be done better –
a better written .emacs will improve the startup time for emacs — but
it does not affect me too much and I am okay living with it for the
moment. Afterall, I start (or at least try to) emacs once a session
and leave it on. For composing my e-mails, I use emacsclient.

Hurray.

V.

Interesting document

February 21, 2008 at 4:55 am | In Announcements for courses, Statistics | Leave a Comment

Making Data Meaningful: A guide to writing stories about numbers

The blurb: The guide is intended as a practical tool to help managers,
statisticians and media relations officers use text, tables, graphics
and other information to bring statistics to life.

Get the pdf version directly from here.

V.

Find type of variables in a data frame

February 21, 2008 at 4:53 am | In Uncategorized | Leave a Comment

sapply(a,class) gives type of field (character, numeric, or factor) for each variable in the data frame a.

Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.