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 arguments as in `graphics::text`, except pad which specifies padding (optionally | |
# for vertical and horizontal) around the text as a fraction of a character width. | |
# `...` is passed to `rect` | |
textbox <- | |
function(x, y, labels, adj = NULL, | |
pos = NULL, | |
offset = 0.5, | |
pad = c(0, 0), | |
vfont = NULL, | |
cex = par("cex"), |
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
@echo off | |
setlocal EnableDelayedExpansion | |
set result= | |
set outfile= | |
set nextisoutfile= | |
set "self=%~n0" | |
:startHelp |
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
require("MuMIn") | |
local({ | |
quasiLik.compar.gee <- | |
function (object, ...) { | |
scale <- object$scale | |
ret <- .qlik(object$residuals + object$fitted.values, object$fitted.values, | |
get(object$family, envir = asNamespace("stats"))(), | |
1, scale) |
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
local({ | |
family.phylolm <- | |
function (object, ...) { | |
stop("???") | |
} | |
logLik.pglmm_compare <- | |
function (object, ...) { | |
rval <- object$logLik |
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
sd.ranef.avg <- | |
function(object) { | |
if(!inherits(object, "averaging")) | |
stop("not an \"averaging\" object") | |
mo <- get.models(object, TRUE) | |
re <- lapply(mo, function(x) as.data.frame(ranef(x, condVar = TRUE))) | |
cols <- c("grpvar", "term", "grp") |
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
#' @return a two-column matrix of turning angles `"ta"` and step lengths `"len"`. | |
#' @param Nstates the number of movement states. | |
#' @param tp a vector of transition probabilities for `Nstates == 2` or a | |
#' square transition matrix `[Nstates, Nstates]`. Ignored if `Nstates == 1` | |
#' @param mu,rho wrapped Cauchy distribution parameters for the turning angles. Should have a length of `Nstates`. | |
#' @param wscale,wshape Weibull distribution parameters for step length | |
# TODO: starting position and initial direction. Currently all are set to 0. | |
mscrwpath <- | |
function(N, Nstates = 2, tp = c(.05, .1), | |
mu = c(0, 0), rho = c(.5, .99), |
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
#' @param formula,data,subset,na.action arguments to `model.frame`. If the first argument is a data frame, the rest is ignored. | |
#' @param method argument to `cor.test`. A character string indicating which correlation coefficient is to be used for the test. One of "pearson", "kendall", or "spearman", can be abbreviated. | |
#' @param n integer; the number of x values at which to evaluate. | |
#' @param lty,col,cex graphical parameters fit line type, line colour, character expansion for labels. | |
#' @param \dots optional, additional arguments passed to `points` | |
#' @example | |
#' data <- data.frame(x = runif(100), x1 = rlnorm(100), x2 = rnorm(100)) | |
#' pairs.cor(~ x + log(x1) + x2, data) | |
pairs.cor <- | |
function(formula, data = NULL, subset = NULL, na.action = na.fail, |
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
# The syntax is very much as in `boxplot` (a large portion of the code is taken | |
# from graphics::boxplot.default and graphics::bxp). | |
# The argument `density.args` should be a named list and is used to pass arguments to `density`. | |
violplot <- | |
function (x, ...) | |
UseMethod("violplot") | |
registerS3method("violplot", "formula", | |
function (formula, data = NULL, ..., subset, na.action = NULL, |
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
#' @param \dots two or more `logLik` objects | |
lrt <- | |
function(...) { | |
logL <- list(...) | |
nmodels <- length(logL) | |
rval <- matrix(rep(NA, 5 * nmodels), ncol = 5) | |
colnames(rval) <- c("#Df", "LogLik", "Df", "Chisq", "Pr(>Chisq)") | |
rownames(rval) <- 1:nmodels | |
rval[, 1] <- as.numeric(sapply(logL, function(x) attr(x, "df"))) |
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
weighted.histogram <- | |
function() { | |
cl <- match.call() | |
cl$w <- NULL | |
cl[[1L]] <- as.name("hist.default") | |
cl$plot <- FALSE | |
h <- eval.parent(cl) | |
f <- factor(findInterval(x, h$breaks, left.open = TRUE, | |
rightmost.closed = TRUE, | |
all.inside = TRUE), |
NewerOlder