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
read.tps = function(data) { | |
# Reads the .tps file format produced by TPSDIG | |
# (http://life.bio.sunysb.edu/morph/ into a single data frame | |
# USAGE: R> read.tps("filename.tps") | |
a = readLines(data) # so we can do some searching and indexing | |
LM = grep("LM", a) # find the line numbers for LM | |
ID.ind = grep("ID", a) # find the line numbers for ID | |
# and the ID values, SCALE values, and image names | |
ID = gsub("(ID=)(.*)", "\\2", grep("ID", a, value=T)) | |
SCALE = gsub("(SCALE=)(.*)", "\\2", grep("SCALE", a, value=T)) |
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
SankeyR <- function(inputs, losses, unit, labels, format="plot"){ | |
######################## | |
# SankeyR version 1.01 (updated August 10, 2010) | |
# is a function for creating Sankey Diagrams in R. | |
# See http://www.sankey-diagrams.com for excellent examples of Sankey Diagrams. | |
# | |
# OPTIONS: | |
# 'inputs' is a vector of input values | |
# 'losses' is a vector of loss values | |
# 'unit' is a string of the unit |
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
plotmatrix2 <- function (data, mapping = aes()) | |
{ | |
grid <- expand.grid(x = 1:ncol(data), y = 1:ncol(data)) | |
grid <- subset(grid, x != y) | |
all <- do.call("rbind", lapply(1:nrow(grid), function(i) { | |
xcol <- grid[i, "x"] | |
ycol <- grid[i, "y"] | |
data.frame(xvar = names(data)[ycol], yvar = names(data)[xcol], | |
x = data[, xcol], y = data[, ycol], data) | |
})) |
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
#' Creates a dialog box using tcl/tk to get input from the user. | |
#' | |
#' This function will create a tcl/tk dialog box to get user input. It has been | |
#' written to be extensible so the R programmer can easily create a dialog with | |
#' any number of varaibles with custom labels and data conversion of the user | |
#' entered data. The function will return a list where the element names are | |
#' \code{vars} and the value is the user input. By default, all entry will be | |
#' converted using the \code{as.character} function. However, this can easily be | |
#' altered using the \code{fun} parameter. For example, if integers are required, | |
#' use \code{fun=c(as.integer, ...)}. It is also possible to write custom |
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
tell application "Microsoft PowerPoint" | |
activate | |
set theView to view of document window 1 | |
repeat with slideNumber from 1 to count of slides of active presentation | |
go to slide theView number slideNumber | |
tell slide slideNumber of active presentation |
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
###################################### | |
## Function calls a PGLMM for logistic regression | |
## Created by Matthew Helmus | |
###################################### | |
PGLMM.fit<-function(dat=NULL,Y=NULL,X=NULL,VV=NULL,sp.init=0.5,maxit=25,exitcountermax=50) # [B,B0,s,S95int,LL,flag]=PGLMM_nosparse_funct(Y,X,VV,s) | |
{ | |
if (!require(corpcor)) | |
{ | |
stop("The 'corpcor' package is required") |
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
###################################### | |
## Function that organizes the data so that PGLMM can be fit | |
## Created by Matthew Helmus | |
## | |
## attempt at fixing the function for use with larger data sets | |
## diag is replaced with Matrix:::Diagonal | |
###################################### | |
require(Matrix) |
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
stat_smooth_func <- function(mapping = NULL, data = NULL, | |
geom = "smooth", position = "identity", | |
..., | |
method = "auto", | |
formula = y ~ x, | |
se = TRUE, | |
n = 80, | |
span = 0.75, | |
fullrange = FALSE, | |
level = 0.95, |