Publications by Jason Bryer

Function for Generating LaTeX Tables with Decimal Aligned Numbers

04.01.2013

The xtable package is tremendously useful for generating LaTeX tables from data frames. It is also pretty easy to customize the output to handle some special cases of LaTeX formatting. The xtable.decimal function will create a LaTeX table where numeric columns will be vertically aligned on the decimal point. In addition to specifying the LaTeX al...

1974 sym R (4421 sym/3 pcs) 2 img

Reading Codebook Files in R

10.01.2013

One issue I continuously encounter when starting to work with a new dataset is that of the codebook. In general, I prefer to load a codebook into R like any other data source, specifically as a data frame. And ideally, one data frame to provides the variable names with descriptions and any other meta data available, and a separate list of named v...

5903 sym R (4813 sym/9 pcs)

Interactive SQL in R

12.01.2013

I recently taught a very basic introduction to SQL workshop and needed a way to have participants interact with SQL statements. Obviously there are lots of tools to interface with a database, but since we are all R users I thought it would be nice to be able interact without leaving R. Although this interface is fairly basic, the fact that we can...

2154 sym R (1333 sym/4 pcs) 2 img

Version 1.0 of sqlutils available on CRAN

15.01.2013

Version 1.0 of sqlutils has been released to CRAN. The sqlutils package is designed to manage a library of SQL files. This package grew out of the needs of an Office of Institutional Research where the vast majority of analysis is conducted on data from our Student Information System (SIS) which is stored in an Oracle database. A lot of our analy...

1948 sym R (55 sym/1 pcs)

Comparing two data frames with different number of rows

24.01.2013

I posted a question over on StackOverflow on an efficient way of comparing two data frames with the same column structure, but with different rows. What I would like to end up with is an n x m logical matrix where n and m are the number of rows in the first and second data frames, respectively; and the value at the ith row and jth column indicate...

2686 sym R (2581 sym/9 pcs)

Converting a list to a data frame

30.01.2013

There are many situations in R where you have a list of vectors that you need to convert to a data.frame. This question has been addressed over at StackOverflow and it turns out there are many different approaches to completing this task. Since I encounter this situation relatively frequently, I wanted my own S3 method for as.data.frame that take...

2230 sym R (1298 sym/7 pcs)

Version 1.0 of multilevelPSA Available on CRAN

14.02.2013

Version 1.0 of multilevelPSA has been released to CRAN. The multilevelPSA package provides functions to estimate and visualize propensity score models with multilevel, or clustered, data. The graphics are an extension of PSAgraphics package by Helmreich and Pruzek. The example below will investigate the differences between private and public scho...

7317 sym R (8617 sym/9 pcs) 6 img

i Before e Except After c

26.03.2013

When I went to school we were always taught the “i before e, except after c” rule for spelling. But how accurate is this rule? Kevin Marks tweeted today the following: »@uberfacts: There are 923 words in the English language that break the “I before E” rule. Only 44 words actually follow that rule.« Science— Kevin Marks (@kevinmarks) ...

3231 sym R (5367 sym/12 pcs) 4 img

Cut Dates Into Quarters

18.04.2013

Frequently I need to recode a date column to quarters. For example, at Excelsior College we have continuous enrollment so we report new enrollments per quarter. To complicate things a bit, our fiscal year starts in July so that July, August, and September represent the first quarter, January, February, and March are actually the third quarter. Bu...

1870 sym R (3791 sym/7 pcs)

Gambler’s Run With Shiny

08.05.2013

I finally had an opportunity to play with Shiny, and I am very impressed. I have created a Github Project so head over there for the source code. There are a number of ways to distribute Shiny apps. If you are running R (and mostly likely you are if you are reading this), you can download and run Shiny apps using the runApp (if already downloaded...

1989 sym R (251 sym/4 pcs) 4 img