I hereby claim:
- I am kjhealy on github.
- I am kjhealy (https://keybase.io/kjhealy) on keybase.
- I have a public key whose fingerprint is 02A0 1BC1 9860 B68F 5170 EC1D 2FA5 B859 36DB 10A2
To claim this, I am signing this object:
| library(dplyr) | |
| library(tidyr) | |
| ## Sample data | |
| tmp <- sample(1:10, 20, replace = TRUE) | |
| tmp2 <- sample(20:50, 20, replace = TRUE) | |
| raw.data <- paste(tmp, tmp2, sep="-") | |
| raw.data |
I hereby claim:
To claim this, I am signing this object:
| ### From Rmd to PDF or html | |
| ## All Rmarkdown files in the working directory | |
| SRC = $(wildcard *.Rmd) | |
| ## Location of Pandoc support files. | |
| PREFIX = /Users/kjhealy/.pandoc | |
| ## Location of your working bibliography file | |
| BIB = /Users/kjhealy/Documents/bibs/socbib-pandoc.bib |
title: Lorem Ipsum author:
The idea is based on a gist by @jimbojsb.
You can use Pygments or Highlight.
brew install python
| ## Lehmann, Schwartz, and Hansen (2008) | |
| ## For use with igraph objects | |
| ## via http://stackoverflow.com/questions/31024481/detect-bi-cliques-in-r-for-bipartite-graph | |
| library(igraph) | |
| computeBicliques <- function(graph, k, l) { | |
| vMode1 <- c() | |
| if (!is.null(V(graph)$type)) { |
| library(XML) | |
| library(ggplot2) | |
| df <- readHTMLTable("http://projects.dailycal.org/paychecker/departments/")[[1]] | |
| DeMoney <- function(x) as.numeric(gsub(",", "", gsub("\\$", "", as.character(x)))) | |
| money.columns <- c("All", "Professor", "Associate professor", "Assistant professor", | |
| "Lecturer") |
| library(XML) | |
| library(ggplot2) | |
| df <- readHTMLTable("http://projects.dailycal.org/paychecker")[[1]] | |
| colnames(df)[4] <- "Salary" | |
| df$Salary <- as.numeric(gsub('[$,]', '', df$Salary)) | |
| p <- ggplot(df, aes(x=Department, y=Salary)) + coord_flip() | |
| p + geom_boxplot(aes(color=Rank, | |
| x=reorder(Department, Salary, FUN=max))) + |
| # Animated dplyr joins with gganimate | |
| # * Garrick Aden-Buie | |
| # * garrickadenbuie.com | |
| # * MIT License: https://opensource.org/licenses/MIT | |
| # Note: I used Fira Sans and Fira Mono fonts. | |
| # Use search and replace to use a different font if Fira is not available. | |
| library(tidyverse) | |
| library(gganimate) |
| ## Start with the code in https://github.com/kjhealy/lexis_surface/blob/master/lexis.r | |
| ## At the bottom, the `fra_surface` object is done in 3D with the `plotly` library. We can | |
| ## also do it with `rayshade`: | |
| library(rayshader) | |
| ## rayshade wants the axes a little differently from plotly | |
| ## but like plotly it wants a matrix. | |
| fra_surf <- fra_surf[c(1:201),c(100:1)] |