Title: | Support for Springer monograph on Bioconductor |
---|---|
Description: | tools for building book |
Authors: | Vince Carey <[email protected]> and Wolfgang Huber <[email protected]> |
Maintainer: | Vince Carey <[email protected]> |
License: | Artistic-2.0 |
Version: | 1.75.0 |
Built: | 2024-10-31 04:18:04 UTC |
Source: | https://github.com/bioc/RbcBook1 |
Illustrative datasets for distance measures
data(ALL.dist) # all the components live in here
data(ALL.dist) # all the components live in here
These datasets are used in conjunction with the bioDist package for the distance chapter of the monograph
these are dist
objects
Vince Carey <[email protected]>
data(ALL.dist) objects() dim(as.matrix(bcr.cor))
data(ALL.dist) objects() dim(as.matrix(bcr.cor))
A function to extract the code chunks from the book for the online supplement.
bcStangle(files = .RbcBook1Files(), outfile= "bioCSpringer.R") tangleToSingleFiles()
bcStangle(files = .RbcBook1Files(), outfile= "bioCSpringer.R") tangleToSingleFiles()
files |
character vector with filenames of book chapters.
Must have extension |
outfile |
character of length 1 with the name of the output file. |
It should suffice to change to the book's top level directory
(e.g. .../Springer1/trunk/Book1)
and run bcStangle()
.
This function is specialized to its one purpose given in the title. It is not envisaged that it could be useful beyond, or even replace Stangle.
tangleToSingleFiles
creates a directory named Rfiles and tangles
each chapter separately into this directory. You must have the current
working directory set to the top level directory of the book
(Springer/Book1).
Function is called for its side effects.
Wolfgang Huber <[email protected]>
.RbcBook1Files, Stangle
## bcStangle()
## bcStangle()
Wrapper for Sweave - allows to set options, or perform additional preprocessing or QC steps.
bcSweave(f)
bcSweave(f)
f |
character, filename. Must have extension |
No details.
Function is called for its side effects.
Wolfgang Huber <[email protected]>
## bcSweave("Intro.Rnw")
## bcSweave("Intro.Rnw")
Formatting and standardization checks on book chapters
checkVerbatim(files = .RbcBook1Files(ext=".tex"), maxc = 70, which = "both", verbose = TRUE) checkRnw(files = .RbcBook1Files(), verbose = TRUE, stopOnError=FALSE) checkPackage(files = .RbcBook1Files(ext=".Rnw"), verbose = TRUE) .RbcBook1Files(ext=".Rnw")
checkVerbatim(files = .RbcBook1Files(ext=".tex"), maxc = 70, which = "both", verbose = TRUE) checkRnw(files = .RbcBook1Files(), verbose = TRUE, stopOnError=FALSE) checkPackage(files = .RbcBook1Files(ext=".Rnw"), verbose = TRUE) .RbcBook1Files(ext=".Rnw")
files |
character vector with names (and path) of chapter source files |
ext |
character of length 1. File name extension. |
maxc |
integer of length 1. Maximal number of characters in a verbatim line. All lines exceeding this limit will be reported in the return value of this function. |
which |
character of length 1. 'Sinput' will look at |
verbose |
Logical. |
stopOnError |
Logical. If FALSE, first error found will lead to stop. If TRUE, try to continue checking. |
checkVerbatimLines
sees whether all verbatim lines have length
at most maxc
.
checkPackage
finds all the occurences of \Rpackage{...}
in the text, checks whether the package is known, and returns a named
list will all occurences of the packages.
For checkVerbatimLines
and checkSetup
, a data frame
with one row for each offending line and various columns
describing it.
For .RbcBook1Files
, a character vector.
Wolfgang Huber <[email protected]>
f = tempfile() zap = function(n) paste(formatC(1:n, width=2), collapse=" ") writeLines(c("*begin{Sinput}", zap(20), zap(30), "*end{Sinput}"), con=f) checkVerbatim(files=f)
f = tempfile() zap = function(n) paste(formatC(1:n, width=2), collapse=" ") writeLines(c("*begin{Sinput}", zap(20), zap(30), "*end{Sinput}"), con=f) checkVerbatim(files=f)
File info for all image files in the book
imageSize(dirs= c("Preproc","Analysis","Metadata","Graphs","CaseStudies"), ext=c("pdf", "png"))
imageSize(dirs= c("Preproc","Analysis","Metadata","Graphs","CaseStudies"), ext=c("pdf", "png"))
dirs |
character vector with directories. |
ext |
character vector with file name extensions. |
No details.
Data frame.
Wolfgang Huber <[email protected]>
# a = imageSize() # print(a[1:10,c(1,4)])
# a = imageSize() # print(a[1:10,c(1,4)])
Results of tedious computations for computational inference
data(Survperformance)
data(Survperformance)
These datasets are used in conjunction with the computational inference chapter of the monograph
these are data.frame
objects
Vince Carey <[email protected]>
data(Survperformance) objects() dim(performance)
data(Survperformance) objects() dim(performance)
Load a lengthy list of packages that are used in the Book
require.RbcBook1() .RbcBook1.pkgs()
require.RbcBook1() .RbcBook1.pkgs()
require.RbcBook1
can be used to see at once whether all packages required
for the book can be loaded.
To do for .RbcBook1.pkgs
: version numbers?
.RbcBook1.pkgs
returns a character vector with the names of
all packages used in the book.
Wolfgang Huber <[email protected]>
## Not run: library(reposTools) install.packages2(.RbcBook1.pkgs(), develOK=TRUE) require.RbcBook1() ## End(Not run)
## Not run: library(reposTools) install.packages2(.RbcBook1.pkgs(), develOK=TRUE) require.RbcBook1() ## End(Not run)
Creates an object of class graphNEL
from one of class rpart
.
rpart2gNEL(tr, remap=function(x) x, nsep="\n")
rpart2gNEL(tr, remap=function(x) x, nsep="\n")
tr |
instance of |
remap |
function that maps node names in tree to node names in graph. |
nsep |
token that separates node name and vote tally in the rendering. |
Not explicitly used in the book, but the basis for a certain graph illustrating application of rpart. The newer coin/party packages have more interesting rendering approaches based on graphviz.
grabSplitV
is a utility function for acquiring the variable
names, remapAff
will remap affymetrix probe names to gene
symbols for use in the remap
parameter.
a graphNEL-class
instance with nodes
constructed to convey information on the data tree fit
Vince Carey <[email protected]>
library(rpart) example(rpart) ff = rpart2gNEL(fit2) ff nodes(ff)
library(rpart) example(rpart) ff = rpart2gNEL(fit2) ff nodes(ff)