Skip to content

Instantly share code, notes, and snippets.

View DaveParr's full-sized avatar

Dave Parr DaveParr

View GitHub Profile
@DaveParr
DaveParr / starship.toml
Last active November 18, 2023 12:02
pop os starship preset
format = """$sudo$os$shell$directory$git_branch$git_status$package$python$conda$rlang$all"""
right_format = """"""
palette = 'dark'
[palettes.light]
orange = '#FBB86C'
highlight_orange = '#FFAD00'
text_orange = '#FFD7A1'
@DaveParr
DaveParr / weaveVowelCrushGainSoft.tidal
Created February 17, 2019 20:40
tidal cycle pattern: weaving arpeggio around vowels with crush and gain
p "synth" $ jux (# speed "[-0.8 6? 2 1]")
$ weave 15 (n (arp "pinkyup" "c'min'8") # s "superhex" )
[vowel "a e i u",
vowel "i [i o] e [o u]",
vowel "<o? u? i? a?>",
crush "<5 [3 2]?>",
gain (sine)
]

Keybase proof

I hereby claim:

  • I am daveparr on github.
  • I am davidparr (https://keybase.io/davidparr) on keybase.
  • I have a public key ASCCw3b-OV_PMeNMaOBikvJ7A-qeNksHc8R2pAfHtPIoJgo

To claim this, I am signing this object:

---
title: "Untitled"
author: "David Parr"
date: "14 August 2018"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
@DaveParr
DaveParr / miniCRAN.R
Created January 19, 2017 09:19 — forked from stephlocke/miniCRAN.R
Getting a local CRAN that combines internal and external packages
## ------------------------------------------------------------------------
# Set the repo for use throughout
cran <- "https://cran.rstudio.org"
# Install
if(!require(miniCRAN)){
install.packages("miniCRAN", repos = cran)
}
## ------------------------------------------------------------------------
@DaveParr
DaveParr / KnitPost.R
Last active August 2, 2016 11:19
A function for knitting .Rmd files to Jekyll .md posts taken from Andrew Brookes
# Sourced from http://brooksandrew.github.io/simpleblog/articles/blogging-with-r-markdown-and-jekyll-using-knitr/
KnitPost <- function(site.path='/pathToYourBlog/', overwriteAll=F, overwriteOne=NULL) {
if(!'package:knitr' %in% search()) library('knitr')
## Blog-specific directories. This will depend on how you organize your blog.
site.path <- site.path # directory of jekyll blog (including trailing slash)
rmd.path <- paste0(site.path, "_Rmd") # directory where your Rmd-files reside (relative to base)
fig.dir <- "assets/Rfig/" # directory to save figures
posts.path <- paste0(site.path, "_posts/articles/") # directory for converted markdown files
@DaveParr
DaveParr / pokePlot.R
Created March 3, 2016 16:20 — forked from dsparks/pokePlot.R
Ridiculous Pokemon plot
# Truly the most ridiculous thing I could think of.
doInstall <- TRUE # Change to FALSE if you don't want packages installed.
toInstall <- c("XML", "png", "devtools", "RCurl")
if(doInstall){install.packages(toInstall, repos = "http://cran.r-project.org")}
lapply(toInstall, library, character.only = TRUE)
# Some helper functions, lineFinder and makeTable
source_gist("818983")
source_gist("818986")
#' When plotting multiple data series that share a common x axis but different y axes,
#' we can just plot each graph separately. This suffers from the drawback that the shared axis will typically
#' not align across graphs due to different plot margins.
#' One easy solution is to reshape2::melt() the data and use ggplot2's facet_grid() mapping. However, there is
#' no way to label individual y axes.
#' facet_grid() and facet_wrap() were designed to plot small multiples, where both x- and y-axis ranges are
#' shared acros all plots in the facetting. While the facet_ calls allow us to use different scales with
#' the \code{scales = "free"} argument, they should not be used this way.
#' A more robust approach is to the grid package grid.draw(), rbind() and ggplotGrob() to create a grid of
#' individual plots where the plot axes are properly aligned within the grid.