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.

Downloading data from the FBI's UCR 2016

The FBI has recently (September 2017) released the raw files for UCR data for 2016. As usual, these files are in fixed-width ASCII files and do not come with a usable setup file. To make this data accessible, I made those setup files using the codebook provided by the FBI along with the raw data. Using the R package asciiSetupReader, I read the data into R and saved it in a number of data formats.