• Template Mode for Emacs

    If you write a lot of R-, Stata-, Gams and/or LaTeX-files templates can make your life more relaxed. Emacs doesn’t have a template system (well there is auto-insert, but I did not find enough information on how to use if for templates). I used to have some templates in a directory and usually I would start with them (and forget that I should save it under another name…). The disadvantage is that you have to jump around in the file to fill out the information you want to have at the top of the file (like project name, topic, file
    Read the rest “Template Mode for Emacs”

  • Formatted code in Word using Emacs

    Sometimes I have to write some documentation using Word instead of LaTeX. In LaTeX you have some nice options for typesetting code be it R, Stata or Gams. In Word, however, there is no easy way to format your code. I found a nice way to get my code nicely formatted (in color) using Emacs: I installed the Windows version of Emacs and there I can “Quick Print” – “Preview with Web Browser”. This opens the file as htm in my browser. I now just save this file somewhere on my computer and open it in Word. The text is
    Read the rest “Formatted code in Word using Emacs”

  • Set the repository for R

    Every time you install a R package, you are asked which repository R should use.
    To set the repository and avoid having to specify this at every package install, create a file .Rprofile in your home directory with the following text:
           myrepo = getOption(“repos”)
           myrepo[“CRAN”] = “http://stat.ethz.ch/CRAN/
           options(repos = myrepo)