Learn R Programming

ptable (version 1.0.0)

plot: Plot the results of the perturbation table generator

Description

plot() makes it easy to visualize the results of the created ptable-object that has been created by create_cnt_ptable(), create_cnt_ptable() or modify_cnt_ptable().

Usage

plot(obj, type = "d", file = NULL, ...)

Value

The selected graph is displayed, but there is no direct return value. The output could also be assigned to an object to receive an object of class ggplot.

Arguments

obj

an object of class ptable

type

(character) type of graph: distribution "d" (standard), perturbation panel ("p"), transition matrix "t"

file

if not NULL, a path to a file (with file extension, e.g. '.pdf' or '.png') where the graph is saved to

...

additional parameters passed to methods

Author

Tobias Enderle

Examples

Run this code

# Create a ptable for frequency count tables and modify the intervals
ptab <- create_cnt_ptable(D = 3, V = 1.05, js = 1, label = "Example")
ptab_mod <- modify_cnt_ptable(ptab, threshold = 0.3, seed = 5432)

# Distribution Plot of the Noise
plot(ptab_mod, type = "d")

# Perturbations Panel of the Noise
plot(ptab_mod, type = "p")

# \donttest{
## Plot and Save the Transition Matrix
plot(ptab_mod, type ="t", 
     file = tempfile("example_tMatrix", fileext = ".pdf"))
# }

Run the code above in your browser using DataLab