Package 'RbcBook1'

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-11-28 06:10:44 UTC
Source: https://github.com/bioc/RbcBook1

Help Index


Illustrative datasets for distance measures

Description

Illustrative datasets for distance measures

Usage

data(ALL.dist) # all the components live in here

Details

These datasets are used in conjunction with the bioDist package for the distance chapter of the monograph

Value

these are dist objects

Author(s)

Vince Carey <[email protected]>

Examples

data(ALL.dist)
objects()
dim(as.matrix(bcr.cor))

A function to extract the code chunks from the book for the online supplement

Description

A function to extract the code chunks from the book for the online supplement.

Usage

bcStangle(files = .RbcBook1Files(), outfile= "bioCSpringer.R")
 tangleToSingleFiles()

Arguments

files

character vector with filenames of book chapters. Must have extension .Rnw

outfile

character of length 1 with the name of the output file.

Details

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).

Value

Function is called for its side effects.

Author(s)

Wolfgang Huber <[email protected]>

See Also

.RbcBook1Files, Stangle

Examples

## bcStangle()

Wrapper for Sweave

Description

Wrapper for Sweave - allows to set options, or perform additional preprocessing or QC steps.

Usage

bcSweave(f)

Arguments

f

character, filename. Must have extension .Rnw

Details

No details.

Value

Function is called for its side effects.

Author(s)

Wolfgang Huber <[email protected]>

Examples

## bcSweave("Intro.Rnw")

Formatting and standardization checks on book chapters

Description

Formatting and standardization checks on book chapters

Usage

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")

Arguments

files

character vector with names (and path) of chapter source files

ext

character of length 1. File name extension. .Rnw (the default) and .tex should be the most important cases.

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 Sinput environments, 'Soutput' at Soutput environments, 'both' at both.

verbose

Logical.

stopOnError

Logical. If FALSE, first error found will lead to stop. If TRUE, try to continue checking.

Details

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.

Value

For checkVerbatimLines and checkSetup, a data frame with one row for each offending line and various columns describing it.

For .RbcBook1Files, a character vector.

Author(s)

Wolfgang Huber <[email protected]>

Examples

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

Description

File info for all image files in the book

Usage

imageSize(dirs= c("Preproc","Analysis","Metadata","Graphs","CaseStudies"), ext=c("pdf", "png"))

Arguments

dirs

character vector with directories.

ext

character vector with file name extensions.

Details

No details.

Value

Data frame.

Author(s)

Wolfgang Huber <[email protected]>

Examples

# a = imageSize()
  # print(a[1:10,c(1,4)])

Results of tedious computations for computational inference

Description

Results of tedious computations for computational inference

Usage

data(Survperformance)

Details

These datasets are used in conjunction with the computational inference chapter of the monograph

Value

these are data.frame objects

Author(s)

Vince Carey <[email protected]>

Examples

data(Survperformance)
objects()
dim(performance)

Load a lengthy list of packages that are used in the Book

Description

Load a lengthy list of packages that are used in the Book

Usage

require.RbcBook1()
.RbcBook1.pkgs()

Details

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?

Value

.RbcBook1.pkgs returns a character vector with the names of all packages used in the book.

Author(s)

Wolfgang Huber <[email protected]>

Examples

## Not run: 
library(reposTools)
install.packages2(.RbcBook1.pkgs(), develOK=TRUE)
require.RbcBook1()

## End(Not run)

rpart to graphNEL Converter

Description

Creates an object of class graphNEL from one of class rpart.

Usage

rpart2gNEL(tr, remap=function(x) x, nsep="\n")

Arguments

tr

instance of rpart class from rpart package.

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.

Details

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.

Value

a graphNEL-class instance with nodes constructed to convey information on the data tree fit

Author(s)

Vince Carey <[email protected]>

See Also

rpart, graphNEL-class

Examples

library(rpart)
example(rpart)
ff = rpart2gNEL(fit2)
ff
nodes(ff)