1. Bootstrap with logistic regression

    A quick example of bootstraping a logistic regression. Nothing special here, example could be extended to any other type of model that has a coef() method. library(boot) logit_test <- function(d,indices) { d <- d[indices,] fit <- glm(your ~ formula, data = d, family = "binomial"

  2. Git pull aborts

    Frequently, I'll be working on a remote and a local copy at the same time. Perhaps this is a bad overall workflow and needs to be rethought. But often, I'll make changes in two locations but only wish to save one but wish to update the other with the changes.

  3. Quick Correlation Heatmap in R

    Find myself remaking this plot over and over. So here's a quick function. Also tests correlation significance. I quite like the spectral palette for the purpose of a heat map. It's not too painful on the eyes and variation is immediately identifiable. #' Create a Heatmap #' #' Function creates

  4. Templating knitr documents

    Code chunks should be minimized with options for customization that reduce overall requirements for repetition. Note: remove \ before triple backticks. It's only there for display purposes (otherwise it breaks the display of code). Function basic_plot_rmd <- function(data,title,new_levels = NULL,flip = NULL, title_level = 2,

  5. Texlive for Rmarkdown on Ubuntu

    When RStudio complains ! LaTeX Error: File 'titling.sty' not found.. Do the following. sudo apt-get install texlive texlive-latex-extra