Skip to content

Instantly share code, notes, and snippets.

View EarlGlynn's full-sized avatar

Earl F Glynn EarlGlynn

View GitHub Profile
@EarlGlynn
EarlGlynn / getMOLicenses.py
Created May 5, 2015 14:13
Download selected Missouri professional registration files
#! /usr/bin/python
# Download selected Missouri professional registration files from
# http://pr.mo.gov/listings.asp
# Typically run via a cron job, e.g., grab at 6:05 AM every Sunday:
# min(0-59) hr(0-23) day(1-31) month(1-12) weekday(0-6) command
# 05 6 * * 0 /home/xxxxxx/data/Missouri-Licenses/get-MOLicenses.py >/dev/null 2>&1
# efg, UMKC CHI, 1 Aug 2014.
@EarlGlynn
EarlGlynn / 256ShadesOfGray.R
Created April 20, 2015 19:15
256 Shades of Gray/Grey in R
grays <- rep("", 256)
for (i in 1:256)
{
hex2 <- sprintf("%02x", i-1);
grays[i] <- paste0("#", hex2, hex2, hex2)
}
barplot(rep(1,256), col=grays, yaxt="n", border=NA, space=0)
@EarlGlynn
EarlGlynn / gist:814be57def1b02664eca
Created April 2, 2015 21:13
Use 7zip on Windows to expand Source directory of .gz files into a Target directory
SET Pgm7Z="C:\Program Files\7-Zip\7z.exe"
SET Source="C:\Users\glynne\Desktop\RAW\reports\GZ"
SET Target="C:\Users\glynne\Desktop\RAW\reports\UnGZ"
FOR %%f IN (%Source%\*.gz) DO %Pgm7Z% x %%f -o%Target%
@EarlGlynn
EarlGlynn / Boxplots-and-Outliers.R
Created October 4, 2014 16:55
R code fragments for "Boxplots and Outliers" talk
# R code fragments used in talk
# Boxplots and Outliers
# Kansas City R Users Group - Beginner's Workshop
# Earl F Glynn, 4 Oct 2014
set.seed(19)
x <- rnorm(11)
x
sort(x)
# Python examples using ftplib package with VMS host.
# Rename VMS files during copy to have version number as part of filename.
# https://docs.python.org/2/library/ftplib.html
# efg, 7 May 2014
import os
from ftplib import FTP
NewLine = "\n"
# Python examples using ftplib package.
# https://docs.python.org/2/library/ftplib.html
# efg, 7 May 2014
# Annoying IDLE setup for up/down arrows on Windows
# https://www.clear.rice.edu/engi128/Resources/usingidle.htm
# Options | Configure IDLE | Keys | history next and history last
import os
from ftplib import FTP
@EarlGlynn
EarlGlynn / R-IO-Excel.R
Last active November 23, 2017 20:53
R Examples of reading an Excel file into a data.frame using XLConnect, gdata and RODBC packages.
# Examples of reading Excel files into R data.frame described here:
# http://earlglynn.github.io/R/input-output/Excel/index.html
#setwd("") # Set working directory if necessary
# Examples
# 1. gdata package: read.xls
# 2. RODBC package: sqlFetch or sqlQuery
# efg, 2014-02-07
@EarlGlynn
EarlGlynn / R-IO-readcsv-writecsv.R
Created January 16, 2014 05:35
read.csv / write.csv examples for KC R Users group, 2014-01-18
# read.csv / write.csv examples described here:
# http://earlglynn.github.io/R/input-output/readcsv-writecsv/index.html
#setwd("") # Set working directory if necessary
# Examples
# 1. Read Sample.csv input file with read.csv.
# 2. Explain some details of data.frame
# 3. Write Sample-Copy.csv output file with write.csv.
# 4. Compare Sample.csv to Sample-Copy.csv.
@EarlGlynn
EarlGlynn / R-IO-writeLines-readLines.R
Created January 15, 2014 05:08
writeLines / readLines examples for KC R Users Group, 2014-01-18
# writeLines / readLines examples described here:
# http://earlglynn.github.io/R/input-output/writeLines-readLines/index.html
#setwd("") # Set working directory if necessary
# Examples:
# 1. Create Sample.csv and Sample.tsv files.
# 2. Verify data correctly writte.
# 3. Read HTML from web page, save to disk.