Skip to content

Instantly share code, notes, and snippets.

@julianflowers
julianflowers / latitude_longitude.txt
Created July 18, 2022 14:41 — forked from pjobson/latitude_longitude.txt
Latitude / Longitude DMS, DDM, DD Regular Expressions
Degrees Minutes Seconds (DMS)
40° 26′ 46″ N 79° 58′ 56″ W
40° 26′ 46″ S 79° 58′ 56″ E
90° 0′ 0″ S 180° 0′ 0″ E
40° 26′ 45.9996″ N 79° 58′ 55.2″ E
Latitudes range from 0 to 90.
Longitudes range from 0 to 180.
Minutes & Seconds range from 0-60
Use N, S, E or W as either the last character,
which represents a compass direction North, South, East or West.
@julianflowers
julianflowers / regex.md
Created July 18, 2022 14:32 — forked from debkanchan/regex.md
RegEx for Latitude and Longitude

Regular Expression(RegExp) for Latitude and Longitude

Just Latitude:

^-?([0-8]?[0-9]|90)(\.[0-9]{1,10})$

matches:

  • 56.3847
  • -56.387

unmatches:

@julianflowers
julianflowers / KnitMarkdownExample.R
Created November 15, 2017 21:52 — forked from mages/KnitMarkdownExample.R
Download markdown file from github and process it with knitr in R
library(googleVis) ## Version >= 0.3.2 required
library(knitr)
library(markdown)
library(RCurl)
## URL to the Markdown example file on github:gist
gist <- "https://raw.github.com/gist/3968910/4633a98fdc5193eb7da156059d182e61ccbfd4a8/MarkdownExampleWithGoogleVis.Rmd"
knitrRmd <- paste(readLines(textConnection(getURL(gist))), collapse="\n")
## Write the content of knitrRmd into a Rmd-file, knit it and convert it
## into a html output. Finally show the file with the R-help http
@julianflowers
julianflowers / houston_crime_data.R
Created August 2, 2017 21:53 — forked from seasmith/houston_crime_data.R
Download and union all Houston crime report Excel files
# -- Load dependencies
library(tidyverse)
library(stringi)
library(readxl)
library(rvest)
# -- Prep for download
# url to get data from
@julianflowers
julianflowers / create-ngrams.R
Created July 13, 2016 05:47 — forked from amir-rahnama/create-ngrams.R
Create N-grams for large text-files (very fast)
source("fast-ngrams.R")
con <- file("path_to_file", "r")
data <- readLines(con, encoding = 'UTF-8')
close(con)
data <- clean(data)
onegram <- text_to_ngrams(decode(data), 1)
bigram <- text_to_ngrams(decode(data), 2)
trigram <- text_to_ngrams(decode(data, 3))
@julianflowers
julianflowers / lsa_hack.r
Created July 13, 2016 05:30 — forked from swayson/lsa_hack.r
Analyze Text Similarity with R: Latent Semantic Analysis and Multidimentional Scaling
# script stolen from http://goo.gl/YbQyAQ
# install.packages("tm")
# install.packages("ggplot2")
# install.packages("lsa")
# install.packages("scatterplot3d")
#install.packages("SnowballC")
#if !(require('SnowballC')) then install.packages("SnowballC")
library(tm)
library(ggplot2)
@julianflowers
julianflowers / BIG DATA with RevoScale R
Created July 5, 2016 07:05 — forked from joseph-rickert/BIG DATA with RevoScale R
Scripts for 2/14/13 Webinar Introduction to R for Data Mining
#------------------------------------------------------------
# REVOLUTION ANALYTICS WEBINAR: INTRODUCTION TO R FOR DATA MINING
# February 14, 2013
# Joseph B. Rickert
# Technical Marketing Manager
#
# BIG DATA with RevoScaleR
#
# Copyright: Revolution Analytics