Because I am a masochistperfectionist, I spent the better part my day making my R code more elegant. I figured out what to do with a simple loop, but wanted to write the code the right way. I always tell myself that the time I spend torturing myselfwriting the right code will help me down the line so I know how to do it next time. I will inevitably forget and spend the same four hours doing the same thing again. As a gift to my future self, I decided that I would write down what I learned because it will likely come up again (you're welcome, future Mike!).

My basic problem comes from the desire to match two lists item-by-item. Python contains a function, zip(), that does this. I want to figure out how to zip in R.

illustration of a cv

I used to think of CVs as a relic of an antiquated system of prestige. But working on some software changed my mind. CVs are, it turns out, pretty complicated artifacts. They reveal a great deal about the professional life of academics and all of the systems on which they come to rely.

Like most academics, I found it difficult to keep my CV up to date. I was surprised to learn that there was not a straight-forward system for managing this information. I thought that there should be a better system. It turns out, I'm not alone. About a week ago, Daniel Laurison posted the following to Twitter ...

I had the good fortune to participate in a conversation about how policies can create positive outcomes for racial integration. The American University Center for Latin American and Latino Studies hosted the event that included nationally renowned scholars and policymakers from the District. I was invited to talk and took the opportunity to provide a context for the DC area.

Black Middle Class
Percent of blacks who have a BA or higher in 20 largest metropolitan areas

I emphasized three major points in my talk. First, race and class are not synonymous in the DC area. A higher percentage of blacks in the DC area have college degrees than any other metropolitan area ...

On Twitter, Phil Cohen asked how he might make a plot showing overlapping distributions:

I think that he was on the right track using transparency, but I am not sure that the color was exactly right. The plot reminded me of what Mike Bostock (my generation's Edward Tufte) did to make a population pyramid.

Phil was also working with another disadvantage: he's using Microsoft Excel. Excel (all Microsoft Office products actually), renders the ...

R presents more of a challenge to Stata on many fronts, one of which is basic data management.

I often find myself calculating the value of one observation given the value of an adjacent value. For example, to assess a lagged effect, I would take the value of the preceding interval. Stata makes this really easy, R not so much.

Here's what we would do in Stata:

set obs 1000
gen i = _n
gen val = round(runiform()*10)
gen lag = val[_n-1]

The last command throws the warning, (1 missing value generated) because the first observation has no lagged observation. The first 10 observations look like this:

. list ...

Example of location bar with lock indicating secure HTTPS connection

I have set up HTTPS on my website (see the closed lock in the address bar?). Webfaction hosts my websites and I set up the TSL certificates I did it using free security certificates from Let's Encrypt. I have done it several times now, but I continue to forget how to do it the next time that I try to set it up. The following are notes to myself that I hope might be helpful to someone else as well. (Note that these instructions work only for websites hosted on Webfaction.)

I participated in a panel yesterday to discuss the book Trespassers?: Asian Americans and the Battle for Suburbia by my friend and colleague, Willow Lung-Amam. I have written out a summary of my comments on this very important and timely book below.

Cover of *Trespassers? Asian Americans and the Battle for Suburbia by Willow Lung-Amam

I want to congratulate Dr. Lung-Amam on the great accomplishment that this book represents. People who want to understand race in its contemporary context should read this book. I intend to assign it to my students for this very purpose.

The way that Lung-Amam scales different levels of geography was impressive. She connects factors as large as the geopolitics of global capital and migration flows to those as ...