Skip to content

Instantly share code, notes, and snippets.

@vsbuffalo
Created November 30, 2010 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vsbuffalo/722005 to your computer and use it in GitHub Desktop.
Save vsbuffalo/722005 to your computer and use it in GitHub Desktop.
This is how I prefer to do data munging in R
d <- local({
s <- apply(obj$qual.freqs[, -1], 1, binsample)
tmp <- t(s)
nr <- nrow(tmp)
dim(tmp) <- c(ncol(tmp)*nrow(tmp), 1)
tmp <- as.data.frame(cbind(1:nr, tmp))
colnames(tmp) <- c('position', 'quality')
return(tmp)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment