You’ve got a pdf file and you’d like to view it with whatever the system viewer is. As usual, that requires something special for Windows and something general for the rest of us. Here goes…

Continue reading “Show me the pdf already”

## No more ascii-art

At least * fourfive* R packages will turn your regression models into pretty latex tables: texreg, xtable, apsrtable, memisc, and stargazer. This is very nice if you happen to be a latex document or its final reader, but it’s not so great if you’re making those models to start with.

What if you wanted to see these *as you were working on them*? In particular what if you wanted to see all your models lined up as if they were *already* Table 4 of the Masterwork Yet To Be Named that is only now slowly taking shape in your mind?

Continue reading “No more ascii-art”

## Formulae in R: ANOVA and other models, mixed and fixed

R’s formula interface is sweet but sometimes confusing. ANOVA is seldom sweet and almost always confusing. And random (a.k.a. mixed) versus fixed effects decisions seem to hurt peoples’ heads too. So, let’s dive into the intersection of these three.

Continue reading “Formulae in R: ANOVA and other models, mixed and fixed”

## Querying an SQLite database from R

You have an SQLite database, perhaps as part of some replication materials, and you want to query it from R. You might want to be able to say:

results < - runsql("select * from mytable order by date")

and get the results back as an R object. Here's a function to do it.

Continue reading "Querying an SQLite database from R"

## Unicode in R packages (not)

Perhaps you are trying to add your nice new object as data for an R package. But wait. It has [gasp] *foreign letters* in its **dimnames**, so ‘R CMD check’ will certainly complain.

What you need is something to turn R’s natural Unicode-processing goodness into a relic from the early days of computing without inadvertently aliasing any words that differ only by non-ASCII element. Here’s a handy iconv-invoking function to do that…

Continue reading “Unicode in R packages (not)”

## R Markdown to other document formats

Perhaps you have a file written in Markdown with embedded R of the kind that RStudio makes so nice and easy but you’d like a range of output formats to keep your collaborators happy. Say latex, pdf, html and MS Word. Here’s what you might do

Continue reading “R Markdown to other document formats”