Skip to content

Instantly share code, notes, and snippets.

View jennybc's full-sized avatar

Jennifer (Jenny) Bryan jennybc

View GitHub Profile
@aronatkins
aronatkins / install-rstudio-daily.sh
Last active February 10, 2022 08:54
Install RStudio daily build on OSX/macOS or Ubuntu Linux
#!/bin/bash
#
# Installs the latest RStudio daily desktop build for OSX/macOS and Ubuntu(amd64)
#
# https://support.rstudio.com/hc/en-us/articles/203842428-Getting-the-newest-RStudio-builds
set -e
install_macos_daily() {
REDIRECT_URL="https://www.rstudio.org/download/latest/daily/desktop/mac/RStudio-latest.dmg"
@aammd
aammd / demolition.R
Created December 3, 2014 21:09
This demonstrates web-scraping in order to generate a list of links on a site, in order to download them all. The example used is the Municipality of Burnaby's list of demolition permits
library("rvest")
library("XML")
links_list <- html("http://www.burnaby.ca/City-Services/Building/Permits-Issued.html") %>%
html_nodes("#ctl15_nestedList a")
## Where do links lead? This is encoded in the attribute "href". First get all the attributes
links_attr <- sapply(links_list, xmlAttrs)
## We have the attributes! each link just became a single named character
@aammd
aammd / character_data.R
Last active August 29, 2015 14:08
This function, based on `rvest`, extracts the Gender, Species, Affilation and Rank for a Star Trek character from the [Star Trek Wiki](http://en.memory-alpha.org/wiki/Portal:Main)
library(rvest)
library(magrittr)
library(tidyr)
library(dplyr)
library(stringr)
character_data <- function(chname){
paste0("http://en.memory-alpha.org/wiki/", chname) %>%
html %>%
html_nodes(".wiki-sidebar") %>%
@dill
dill / yosemiteR.md
Last active October 25, 2015 19:09
Getting Yosemite and R to play nice...

Getting Yosemite and R to play nice

Here are some tips on getting R development working with Yosemite. Contribute what you know below and I'll add it in.

homebrew

I went ahead and re-installed all of my homebrew. You can find out what you have installed with

@rasmusab
rasmusab / significance_test.R
Last active June 10, 2020 21:01
A Significantly Improved Significance Test! Not! (More context in this blogpost: http://www.sumsar.net/blog/2014/02/a-significantly-improved-test/)
# Test of Significance, takes the same arguments as t.test() .
signif.test <- function(x, ...) {
p <- t.test(x, ...)$p.value
# List of p excuses retrieved from http://mchankins.wordpress.com/2013/04/21/still-not-significant-2/
p_excuses <- c(
"(barely) not statistically significant <p>",
"a barely detectable statistically significant difference <p>",
"a borderline significant trend <p>",
"a certain trend toward significance <p>",