This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' formats proc_time as a "hh:mm:ss" time string | |
#' | |
#' @seeAlso print.proc_time, proc.time | |
#' | |
formatTime <- function(x){ | |
stopifnot(inherits(x, "proc_time")) | |
h <- x %/% 3600L | |
m <- (x %% 3600L) %/% 60L | |
s <- x %% 60L | |
ifelse(is.na(x), NA, sprintf("%02d:%02d:%2.2f",h,m,s)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################################ | |
all:pdf # default rule DO NOT EDIT | |
################################################################################ | |
MAINFILE := main | |
RNWFILES := | |
RFILES := | |
TEXFILES := | |
CACHEDIR := cache | |
FIGUREDIR := figures | |
DRIVER := pgfSweave |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Makefile for generating R packages. | |
# 2011 Andrew Redd | |
# | |
# Assumes Makefile is in a folder where package contents are in a subfolder pkg. | |
# Roxygen uses the roxygen2 package, and will run automatically on check and all. | |
PKG_VERSION=$(shell grep -i ^version pkg/DESCRIPTION | cut -d : -d \ -f 2) | |
PKG_NAME=$(shell grep -i ^package pkg/DESCRIPTION | cut -d : -d \ -f 2) | |
R_FILES := $(wildcard pkg/R/*.R) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################################ | |
# Copyright 2011 | |
# Andrew Redd | |
# 11/23/2011 | |
# | |
# Description of File: | |
# Makefile for knitr compiling | |
# | |
################################################################################ | |
all:pdf # default rule DO NOT EDIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(Rgraphviz) | |
library(plyr) | |
parserGraph <- function(x){ | |
d0 <- attr(x, 'data') | |
d <- mutate(d0, id =as.character(id), parent=as.character(parent)) | |
stopifnot(inherits(x, "parser")) | |
g <- new("graphNEL", nodes=as.character(d$id), edgemode='directed') | |
d_ply(d, .(id), with, { | |
if(parent %in% d$id) | |
g <<- addEdge(id, parent, g, 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(xtable) | |
texprint<-new.env(parent=.GlobalEnv) | |
texprint$print<-function(x, ...){ | |
UseMethod("texprint") | |
} | |
texprint$texprint.default <- function(x, ...){ | |
UseMethod("print") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(plyr) | |
library(stringr) | |
#' Convenient interface for computing statistics on a vector | |
#' @author Andrew Redd | |
#' | |
#' @param x the vector | |
#' @param ... statistics to compute, must take a vector and return a vector | |
#' @param .na.action the action to take on NA values, for all statistics | |
#' | |
#' @return A one row \code{data.frame} with columns named as in \code{...} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Copyright Andrew Redd 2012 | |
#' Licensed under GPLv3 or newer | |
#' Nest functions | |
#' @return new function cosisting of the functions nested | |
compose <- function(..., .list){ | |
l <- if(missing(.list)) { | |
list(...) | |
} else { | |
.list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Print a table with text borders. | |
#' @param df a data.frame or matrix | |
#' | |
#' Prints a table with borders of |, -, +, and = which is usefull for | |
#' formating tables to use with markdown. | |
#' | |
#' @importFrom stringr str_c str_length str_dup | |
#' @importFrom dostats compose | |
#' @export | |
#' @examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows Registry Editor Version 5.00 | |
[HKEY_CLASSES_ROOT\.R] | |
@="Rsource" | |
[HKEY_CLASSES_ROOT\.Rout] | |
@="Routput" | |
[HKEY_CLASSES_ROOT\Rsource] | |
@="R Source" |
OlderNewer