Skip to content

Instantly share code, notes, and snippets.

@brobb1
brobb1 / split_lines.R
Created August 3, 2018 14:56 — forked from dblodgett-usgs/split_lines.R
Splits lines longer than a given threshold into the minimum number of pieces to all be under the given threshold.
#' @title split lines
#' @description Splits lines longer than a given threshold into the minimum number of pieces to all be under the given threshold.
#' @param lines data.frame of class sf with LINESTRING sfc column.
#' @param max_length maximum segment length to return
#' @param id name of ID column in data.frame
#' @return only the split lines.
#' @importFrom dplyr group_by ungroup filter left_join select rename mutate
#' @export
#'
split_lines <- function(input_lines, max_length, id = "ID") {
@brobb1
brobb1 / encryptWithChaos.m
Created January 25, 2018 17:58 — forked from PabRod/encryptWithChaos.m
An easy version of the method for using chaos to encrypt an audio message described in Strogatz's Nonlinear dynamics and chaos, 1994
%% Encrypt with chaos
% An easy version of the method for using chaos to encrypt an audio message
% described in Strogatz's Nonlinear dynamics and chaos, 1994
%
% More information at: <http://mappingignorance.org/2016/05/09/the-sound-of-chaos/>
%% Load the original sound
load handel;
sampling_freq = Fs;