Skip to content

Instantly share code, notes, and snippets.

View nickhepler's full-sized avatar

Nick Hepler nickhepler

View GitHub Profile
@nickhepler
nickhepler / rstudio_header_snippet.R
Last active April 1, 2020 18:09
Snippet for file header in RStudio
snippet header
## ---------------------------
##
## File name:
##
## Description:
##
## Version: 0.0.1
##
## Author: Nick Hepler
@nickhepler
nickhepler / GitIssueLabels.md
Last active September 13, 2019 03:10
Git Repo Issue Labels

#GitHub Repository Issue Labels

*bug *duplicate *enhancement *help wanted *invalid *question *wont fix

@nickhepler
nickhepler / datasets.md
Last active August 15, 2017 22:44
Public Datasets

Public Datasets

Criminal Justice (United States)

Bureau of Justice Statistics (BJS)

Statistics about Crime and victims, Drugs and crime, Criminal offenders, The justice system in the United States, Law enforcement, Prosecution, Courts and sentencing, Corrections, Justice expenditure and employment.

Data Portals

Amazon Web Services (AWS) Public Data Sets*

Public Datasets on AWS provides a centralized repository of public datasets that can be seamlessly integrated into AWS cloud-based applications. AWS is hosting the public datasets at no charge for the community, and like all AWS services, users pay only for the compute and storage they use for their own applications.

@nickhepler
nickhepler / .gitignore
Created March 18, 2017 14:57 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@nickhepler
nickhepler / RProjectOutline.md
Created March 8, 2017 14:24
R Project Process / File Structure

R Project Process / File Structure

  1. Import
  2. Tidy
  3. Tranform
  4. Visualize
  5. Model
---
title: "Codebook template"
author: "Your name here"
date: "The date here"
output:
html_document:
keep_md: yes
---
## Project Description
@nickhepler
nickhepler / ggplot_template.R
Created August 25, 2016 00:16
R Graphing Template
ggplot(data = <DATA>) +
<GEOM_FUNCTION>(mapping = aes(<MAPPINGS>))
@nickhepler
nickhepler / R Package Installer Script
Last active August 24, 2016 23:30
install_packages.R
pkgs <- c(
"dplyr", "gapminder", "ggplot2", "jsonlite", "Lahman",
"lubridate", "modelr", "nycflights13", "purrr", "readr",
"stringr", "tibble", "tidyr"
)
install.packages(pkgs)

base

Data Structure

str(x)  # Compactly display the internal structure of an R object.
class(x)  # Return the object class.
dim(x)  # Retrieve or set the dimension of an object.
nrow(x)  # Return the number of rows (observations).
ncol(x)  # Return the number of columns (variables).
object.size(x)  # Provides an estimate memory used to store an R object.
names(x)  # Get or set the names of an object.

head(x) # Returns the first part of a vector, matrix, table, data frame or function.

@nickhepler
nickhepler / template.tex
Created June 19, 2015 18:50
Statistical Report Template by Hadley Wickham
% <one line to give the program's name and a brief idea of what it does.>
%
% Copyright (C) <year> <name of author>
%
% Version <x.y.z>
%
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2 of the License, or
% (at your option) any later version.