R

Introduction to R Markdown for a Thesis

Writing a thesis is stressful. R Markdown can help by reducing the number of things you have to think about. This guide can be used as an introduction to R Markdown, specifically for people working on a research thesis. If you’d like to follow along with the actual R Markdown file, here is a link to that. The file you want is “2018-03-11-introduction-to-r-markdown.Rmd” and you can download it by right clicking and downloading.

Where Recreational Marijuana is Sold in California

The new year brings the start of recreational marijuana sales in California. According to an article on capradio.com, only part of the state has accesses to recreational marijuana stores. That is due to a mix of municipalities banning stores within their jurisdiction as well as only a limited number of stores given licenses to sell. I decided to look at where people in California could buy recreational marijuana. The state government’s Bureau of Cannabis Control lists all businesses with licenses to be involved with marijuana.

Reading Fixed-Width ASCII Files into R

The majority of old (pre-2010) government data on crime comes in fixed-width ASCII files that have SPSS (file extension .sps) or SAS (file extension .sas) setup files. Important crime data (e.g. UCR and NIBRS) is still being released in this format. I created the R package asciiSetupReader to use R users be able to read this type of data. Here I will explain how these files work in theory, then walk through an example of using the package.

Do Mexican Immigrants Cause Crime?

There has been a lot of talk lately about immigration. In particular, about if immigrants cause crime in the cities they go to. Like a lot of controversial topics, this one is based mainly in anecdotes and exaggerations. Here is some data regarding the issue. In this post I look at the relationship between crime rates and Mexican immigrant population in 102 counties between 1980 and 2010. For a full methodology and the R code used to analyze the data, see below.