This file contains hidden or 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(survival) | |
##---------- | |
## example 1 | |
set.seed(123) | |
group <- factor(rep(LETTERS[1:2], each=100)) | |
Xbeta <- c(-1, 1)[unclass(group)] + rnorm(200, 0, 2) | |
weibA <- 1.5 | |
weibB <- 100 | |
U <- runif(200, 0, 1) |
This file contains hidden or 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
## DJV 1 target, see http://imgur.com/LHiZFeG | |
## unit x y -> cm | |
## points on outer polygon (ring 1) | |
djv1 <- read.table(file=textConnection("x y | |
25.4 67.9 | |
21.2 59.3 | |
27.5 49.4 | |
36.7 46.2 | |
50.4 46.2 | |
57.2 47.3 |
This file contains hidden or 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
# check modified dummy.coef.lm(), print.dummy_coef() | |
# example from summary.manova | |
tear <- c(6.5, 6.2, 5.8, 6.5, 6.5, 6.9, 7.2, 6.9, 6.1, 6.3, | |
6.7, 6.6, 7.2, 7.1, 6.8, 7.1, 7.0, 7.2, 7.5, 7.6) | |
gloss <- c(9.5, 9.9, 9.6, 9.6, 9.2, 9.1, 10.0, 9.9, 9.5, 9.4, | |
9.1, 9.3, 8.3, 8.4, 8.5, 9.2, 8.8, 9.7, 10.1, 9.2) | |
opacity <- c(4.4, 6.4, 3.0, 4.1, 0.8, 5.7, 2.0, 3.9, 1.9, 5.7, | |
2.8, 4.1, 3.8, 1.6, 3.4, 8.4, 5.2, 6.9, 2.7, 1.9) | |
Y <- cbind(tear, gloss, opacity) | |
rate <- factor(gl(2, 10), labels = c("Low", "High")) |
This file contains hidden or 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
# modified against R-Devel build 2016-01-22 r69971 | |
# File src/library/stats/R/dummy.coef.R | |
# Part of the R package, https://www.R-project.org | |
# | |
# Copyright (C) 1998 B. D. Ripley | |
# Copyright (C) 1998-2015 The R Core Team | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or |
This file contains hidden or 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
knit_hooks$set(output=function(x, options) paste("\\[code\\]\n", x, "\\[/code\\]\n", sep="")) | |
knit_hooks$set(source=function(x, options) paste("\\[code lang='r'\\]\n", x, "\\[/code\\]\n", sep="")) |
This file contains hidden or 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
knit2wp <- function(file) { | |
require(XML) | |
content <- readLines(file) | |
content <- htmlTreeParse(content, trim=FALSE) | |
content <- paste(capture.output(print(content$children$html$children$body, | |
indent=FALSE, tagSeparator="")), | |
collapse="\n") | |
content <- gsub("<?.body>", "", content) | |
content <- gsub("<?pre><code class=\"r\">", "\\[code lang='r'\\]\\\n", | |
content) |
This file contains hidden or 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
[code lang='r']...[/code] |