Skip to content

Instantly share code, notes, and snippets.

View markvanderloo's full-sized avatar

Mark van der Loo markvanderloo

View GitHub Profile
install.packages("hashr")
drat::addRepo("markvanderloo")
install.packages("stringdist")
library(stringdist)
library(quanteda)
library(stringr)
@markvanderloo
markvanderloo / dendrofun.R
Last active September 6, 2016 15:12
d3 dendrograms with R
require(dendextend)
require(whisker)
# plot dendrogram to html string.
#
# d a dendrogram object
# height/widht : pixels, height/widht of the plot
# rightmargin : pixels to reserve on the right side for leaf labels.
#
d3dendrogram <- function(d,height=500,width=700,rightmargin=200){
@markvanderloo
markvanderloo / build.bash
Created July 18, 2013 12:51
bash file for building R packages. Expects the following directory and file structure main_folder roxygen.R - pkg -- R - build -- DESCRIPTION (everything exept collate field, which will be copied and filled by roxygen) -- NAMESPACE (completely empty idem)
#!/bin/bash
R=R
if [ ${#} -gt 0 ]; then
if [ "$1" = "-dev" ]; then
R=Rdev
fi
fi
echo "######## Removing building information..."