This is a text. but changed this feel free to delete this.
- WHy
- Don't
- I Try
- A Bulleted list?
I added this.
This is a text. but changed this feel free to delete this.
I added this.
| rationalFractionApproximator <- function(dec, maxDenom = 1000){ | |
| denomSeq <- 1:maxDenom | |
| impliedNumerator <- dec * denomSeq | |
| roundNumerator <- round(impliedNumerator) | |
| absError <- abs(roundNumerator / denomSeq - dec) | |
| minMinimand <- which.min(absError * denomSeq) | |
| minDenom <- denomSeq[minMinimand] | |
| minNumer <- roundNumerator[minMinimand] | |
| line2 <- paste0(minNumer, " / ", minDenom, " = ", minNumer / minDenom) |
| Projector <- function(st, loopover, iteration){ | |
| Currently <- Sys.time() | |
| Elapsed <- (Currently - st) * length(loopover)/which(iteration == loopover) | |
| units(Elapsed) <- "mins" | |
| return(st + Elapsed * 60) | |
| } | |
| StartTime <- Sys.time() | |
| for(oo in c(1:50)){ | |
| print(oo) |
| GroupRank <- function(x, group){ unsplit(lapply(split(-x, group), rank), group) } |
| Reorderer <- function(tofactor, inorder){ factor(tofactor, levels = tofactor[order(inorder)]) } |
| spaceTrim <- function(x){ gsub("(^ +)|( +$)", "", x) } |
| Pad0 <- function(x, mx=NULL, fill=0) { | |
| ## pad numeric vars to strings of specified size | |
| lx <- nchar(as.character(x)) | |
| mx.calc <- max(lx, na.rm=TRUE) | |
| if (!is.null(mx)) { | |
| if (mx<mx.calc) { | |
| stop("number of maxchar is too small") | |
| } | |
| } else { | |
| mx <- mx.calc |
| # Correlation ellipses | |
| doInstall <- TRUE # Change to FALSE if you don't want packages installed. | |
| toInstall <- c("ellipse") | |
| if(doInstall){install.packages(toInstall, repos = "http://cran.r-project.org")} | |
| lapply(toInstall, library, character.only = TRUE) | |
| # Function to plot colored correlation ellipses | |
| correlationEllipses <- function(cor){ | |
| require(ellipse) |
| # Illustrative use of plyr | |
| # LOAD LIBRARIES REQUIRED | |
| library(plyr); | |
| library(XML) | |
| # FIGURE OUT PATTERN OF URL FOR EACH SEASON | |
| url.b1 = 'http://ca.sports.yahoo.com/nhl/stats/byposition?pos=C,RW,LW,D'; |