Learn R Programming

Overview

The goal of crimeutils is to provide a set of helper functions to make common data tasks in criminology research - clean, explore, analyze, visualize - a bit easier.

Installation

You can install the released version of crimeutils from CRAN with:

install.packages("crimeutils")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("jacobkap/crimeutils")

Usage

library(crimeutils)

Copy Link

Version

Install

install.packages('crimeutils')

Monthly Downloads

260

Version

0.5.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Jacob Kaplan

Last Published

December 7th, 2022

Functions in crimeutils (0.5.1)

time_series_data_graph

Create a PDF with one time-series graph for each group in the data.
ucr_constant_reporter_oris

Get ORIs that consistently report their data every year.
scatterplot_data_graph

Create a PDF with one scatterplot for each group in the data.
theme_crim

A minimalist theme designed for graphics in academic research
make_mean_median_mode_table_by_group

Create a table showing the mean, median, and mode of a certain column
make_desc_stats_table

Create a descriptive statistics table from numeric variables
make_average_graph

Create a line graph with 95% confidence interval bars
make_barplots

Make a nice-looking barplot.
make_latex_tables

Creates a .tex file with LaTeX code to create a table from an R data.frame.
make_regression_table

Turns regression results in a data.frame for easy conversion to a table
make_regression_graph

Make a graph of coefficient values and 95 percent confidence interval for regression.
make_stat_count_plots

Make a nice-looking stat_count (similar to barplot) plot.
make_n_and_percent_table

Make a table showing the number (n) and percent of the population (e.g. % of nrow()) for each value in a variable(s).
capitalize_words

Capitalizes the first letter of every word
scale_fill_crim

A set of colorblind friendly fill colors for graphs.
indicate_outliers

Creates new columns to indicate which values are outliers based on the average value.
scale_linetype_crim

A set of linetypes
make_mean_std_dev_by_group_table

Get mean and standard deviation of variables by group
%>%

Pipe operator
scale_color_crim

A set of colorblind friendly colors for graphs.
make_state_abb

Returns abbreviations of state name input.
pad_decimals

Pad decimal places with trailing zeros.