Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am lordsutch on github.
  • I am lordsutch (https://keybase.io/lordsutch) on keybase.
  • I have a public key whose fingerprint is 6958 A410 0D18 3097 8B3D ACB6 C9FC 41B8 F98C 66CF

To claim this, I am signing this object:

@lordsutch
lordsutch / README.md
Last active December 25, 2015 17:59 — forked from mbostock/.block
Futzing with OSM Vector Tiles
@lordsutch
lordsutch / dropquizzes.R
Created November 14, 2012 15:41
Add a variable to a data frame giving a mean of a set of quiz grades, dropping n grades
## Note: we're assuming each grade should be weighted equally here.
dropmean <- function(x, drop=2) {
count <- length(x)-drop
round(sum(sort(x, decreasing=TRUE)[seq(1, count)], na.rm=T)/count, 2)
}
## Same formula for multiple sections; note list.files uses a regex pattern, not a glob pattern
infiles <- list.files(pattern='^gradebook-quizzes-[0-9]+\\.csv$')
for(filename in infiles) {