Skip to content

Instantly share code, notes, and snippets.

@hugh1li
hugh1li / .gitignore
Created December 28, 2018 01:56 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@hugh1li
hugh1li / make_kmz.r
Created August 14, 2018 13:47 — forked from benfasoli/make_kmz.r
R KMZ mapping function for points and lines
#' Generates a KMZ file
#' @author Ben Fasoli
#'
#' \code{make_kmz} generates a KMZ representation of surface observations.
#'
#' @param data to be plotted on Z axis
#' @param time vector of times for data observations
#' @param lat latitude, in dd.dddd
#' @param lon longitude, in dd.dddd
#' @param filepath character path to output file, ending in '.kmz'
@hugh1li
hugh1li / README.md
Created April 26, 2018 20:15 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet
@hugh1li
hugh1li / stratified.R
Created March 5, 2018 14:20 — forked from mrdwab/stratified.R
Stratified random sampling from a `data.frame` in R
stratified <- function(df, group, size, select = NULL,
replace = FALSE, bothSets = FALSE) {
if (is.null(select)) {
df <- df
} else {
if (is.null(names(select))) stop("'select' must be a named list")
if (!all(names(select) %in% names(df)))
stop("Please verify your 'select' argument")
temp <- sapply(names(select),
function(x) df[[x]] %in% select[[x]])