plot.bsnsing {bsnsing}R Documentation

Generate latex code for plotting a bsnsing tree

Description

If the file argument is supplied, this function will invoke the external programs latex, dvips and ps2pdf. If these programs are not available, only the latex code will be generated. If the file argument is left empty, the latex code will be written to the console screen. The latex code utilizes the following packages: pstricks, pst-node, pst-tree.

Usage

## S3 method for class 'bsnsing'
plot(
  x,
  file = "",
  class_labels = c(),
  class_colors = c("red", "green"),
  rule_font = c("footnotesize", "scriptsize", "tiny", "normalsize", "small"),
  rule_color = "blue",
  footnote = FALSE,
  landscape = FALSE,
  papersize = c("a0paper", "a1paper", "a2paper", "a3paper", "a4paper", "a5paper",
    "a6paper", "b0paper", "b1paper", "b2paper", "b3paper", "b4paper", "b5paper",
    "b6paper", "c0paper", "c1paper", "c2paper", "c3paper", "c4paper", "c5paper",
    "c6paper", "b0j", "b1j", "b2j", "b3j", "b4j", "b5j", "b6j", "ansiapaper",
    "ansibpaper", "ansicpaper", "ansidpaper", "ansiepaper", "letterpaper",
    "executivepaper", "legalpaper"),
  verbose = FALSE,
  ...
)

Arguments

x

an object of class bsnsing.

file

a writable connection or a character string naming the file to write to. If not supplied, the output will be written to the console.

class_labels

a character vector of two elements for leaf node label (for 0 and 1). If empty, the labels will be read from the bsnsing object.

class_colors

a character vector of two elements for leaf node color (for 0 and 1)

rule_font

a string specifying the font size of the split rule at each non-leaf node

rule_color

a string specifying the color of the split rule and node, e.g., blue, gray, black, etc. For a list of all usable colors, see https://en.wikibooks.org/wiki/LaTeX/Colors

footnote

a boolean value indicating whether to add annotation text to the PDF page. The default is FALSE.

landscape

a boolean value indicating if the PDF page should be in landscape layout. The default is FALSE.

papersize

a string specifying the PDF paper size. The default is 'a0paper'.

verbose

a logical value, default is FALSE.

...

further parameters to the plot function.

Value

No return value.

Examples

bs <- bsnsing(Class ~ ., data = GlaucomaMVF)
plot(bs)
## Not run: 
plot(bs, file = 'GlaucomaMVF_tree.pdf')
plot(bs, file = 'GlaucomaMVF_tree_letterpaper.pdf', paper='letterpaper')

## End(Not run)

[Package bsnsing version 1.0.1 Index]