Publications by Jason
Filtering a list with the Filter higher-order function
Last week markbulling over at Drunks & Lampposts posted a method of using sapply to filter a list by a predicate. Today the @RLangTip tip of the day was to use sapply similarly. This made makes me wonder if R‘s very useful higher-order functions aren’t as well known as they should be. In this case, the Filter higher-order function would be th...
1415 sym R (168 sym/2 pcs)
Closures in R: A useful abstraction
People who have been using R for any length of time have probably become accustomed to passing functions as arguments to other functions. From my experience, however, people are much less likely to return functions from their own custom code. This is too bad because doing so can open up a whole new world of abstraction that can greatly decrease t...
4120 sym R (797 sym/7 pcs)
R Tip: Avoid using T and F as synonyms for TRUE and FALSE
By default when you start R, T and F are defined as TRUE and FALSE. When I review other people’s code, I often see functions defined with arguments set to these values by default. This is a very bad idea. T and F are symbols that can be redefined, so it shouldn’t be assumed that they will always evaluate to TRUE and FALSE. Making that assumpt...
1790 sym R (369 sym/4 pcs)
Pearson’s r: Not a good measure of electoral persistence
Pearson’s product-moment correlation, \(r\), is an incredibly useful tool for getting some idea about how two variables are (linearly) related. But there are times when using Pearson’s \(r\) is not appropriate and, even if linearity and all other assumptions hold, using it may lead one astray. I recently ran into such a situation when looking...
5106 sym R (824 sym/1 pcs) 4 img
Boolean 3 (finally) on CRAN
I have finally managed to get boolean3 accepted to CRAN. You can find it here: boolean3 on CRAN. To summarize: boolean3 provides a means of estimating partial-observability binary response models following boolean logic. boolean3 was developed by Jason W. Morgan under the direction of Bear Braumoeller with support from The Ohio State Univer...
578 sym Python (432 sym/1 pcs)
R and MPI on Ohio Supercomputer Center’s Oakley cluster
A few years ago, I wrote a short guide to Using R and snow on the Ohio Supercomputer Center’s Glenn cluster. Several things have changed in the world of R since then (namely, the inclusion of the parallel package into the base system) and I have moved to using the Oakley cluster, so I thought it was time to write an update to that older post. I...
3240 sym R (3262 sym/19 pcs)