I hereby claim:
- I am stillmatic on github.
- I am hua (https://keybase.io/hua) on keybase.
- I have a public key whose fingerprint is 6334 1815 CDA1 CE92 9D08 90F8 1EA6 17AD CD6D 0FBF
To claim this, I am signing this object:
[ | |
{ | |
"x": "2014-06-11", | |
"y": 20, | |
"group": 1 | |
}, | |
{ | |
"x": "2014-06-12", | |
"y": 25, | |
"group": 1 |
#2012 | |
load("C:/120/wptp/sesh1.RData") | |
attach(newdata); | |
with(newdata, plot(I.formed.a.positive.relationship.with.my.tutee.. ~ Semesters)) | |
with(newdata, plot(Semesters ~ Academic.Year)) | |
with(newdata, plot(Are.you.a.section.leader. ~ Academic.Year)) | |
.f = function( | |
lm(Tutor.at.the.same.site ~ My.tutee.benefited.from.tutoring.sessions..) | |
#Intercept: 0.1694 Coeff: 0.1565 |
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<link rel="import" href="../core-icons/core-icons.html"> | |
<link rel="import" href="../paper-item/paper-item.html"> |
# mlb hall of fame classification analysis | |
# chua@wharton.upenn.edu | |
# attempt to follow https://google-styleguide.googlecode.com/svn/trunk/Rguide.xml | |
rm(list=ls()) | |
par(mfrow=c(1,1)) | |
if (!require("pacman")) install.packages("pacman") | |
pacman::p_load("Lahman", "dplyr", "ggplot2") |
# chua@wharton.upenn.edu | |
## my cached version may be slightly different than the live version loaded by this file | |
if (!require("pacman")) install.packages("pacman") | |
pacman::p_load("Lahman", "dplyr") | |
batting <- summarize(group_by(Batting, playerID), | |
ab=sum(AB, na.rm=TRUE), r=sum(R, na.rm=TRUE), | |
h=sum(H, na.rm=TRUE), x2b=sum(X2B, na.rm=TRUE), | |
x3b=sum(X3B, na.rm=TRUE), hr=sum(HR, na.rm=TRUE), |
# mlb hall of fame classification analysis | |
# chua@wharton.upenn.edu | |
rm(list = ls()) | |
par(mfrow = c(1, 1)) | |
if (!require("pacman")) install.packages("pacman") | |
pacman::p_load("Lahman", "dplyr", "ggplot2") | |
# get career batting totals |
# simple utility function to plot a bunch of graphs in a square-ish fashion | |
findOptArrangement <- function(k) { | |
# k: number of plots to arrange | |
# given k, find most square-like arrangement of the data | |
s <- sqrt(k) | |
f <- floor(s) | |
if(s %% 1 == 0 ) { | |
par(mfrow=c(s,s)) | |
} else { |
#' Wrapper function to throw OS X notifications. | |
#' | |
#' @title OSX notifier | |
#' @author \href{https://github.com/stillmatic}{Chris Hua} | |
#' | |
#' @param message Body text of notification | |
#' @param title Title of notification | |
#' @param sound Optional. Valid sounds are in `~/Library/Sounds` or `/System/Library/Sounds` | |
#' | |
#' @return an AppleScript notification |
########## | |
#' Applies a function to subsets of a given dataset. | |
#' Note: sets values without sufficient data to NA. | |
#' Using 'step' is particularly useful for leave-one-out analysis. | |
#' | |
#' @export | |
#' @name slide_apply | |
#' @author \href{https://github.com/stillmatic}{Chris Hua} | |
#' @title Use apply over a sliding window of data | |
#' @param data Array of data to apply the function over. |
I hereby claim:
To claim this, I am signing this object: