Install Pandoc: http://pandoc.org/ library(knitr) knit('report.Rmd') #This creates 'report.md' Open the Terminal, Command Prompt (search for cmd) or Windows Powershell, go to the folder and do: pandoc -s report.md -o report.tex And that’s it! (Read this, if you want vector images.)

Continue reading

I’ve recently started using ggplot2 in addition to lattice (see this post that I made a while ago, explaining how I got into using lattice in the first place). Hint: when using ggplot2, you’ll need to use of the reshape2 package (also written by the amazing Hadley Wickham) to get your data into a form that ggplot2 works best with. Another thing that you’ll want to think about when using ggplo2 is factor levels.

Continue reading

Firstly, start off your table in http://www.tablesgenerator.com/. Tables Generator will do a lot for you. Its most useful features are importing from .csv and merging cells. The Booktabs table style (alternative to default table style from the menu) looks a bit nicer and is “publication quality”. Note that publication quality tables should not contain vertical lines. Code #1 is the code from Tables Generator with the addition of caption, label and Latex document begin-end (so it’s compilable).

Continue reading

This is a short note based on this. Answer in short: Because different formulas are used to calculate the R-squared of a linear regression, depending on whether it has an intercept or not. R2 for a linear model that has an intercept: , where y is the variable that the linear model is trying to predict (the response variable), y^ is the predicted value and y- is the mean value of the response variable.

Continue reading

Author's picture

Riinu Pius (Ots)

if it aint broke, you’re outdated

Senior Data Manager

Edinburgh, UK