GenerateEntryWiseFigures: Generate Entry Wise Figures

Description Usage Arguments Value Examples

View source: R/GenerateEntryWiseFigures.R

Description

This function plots the number of mis-predictions versus perturbation value, overlaid with distribution over stable perturbation values. Run after ComputeEntryWisePerturbationExpectation()

Usage

1
2
3
4
5
6
7
GenerateEntryWiseFigures(
  input_folder = NULL,
  EntryWise = NULL,
  prefix = NULL,
  all_numswitch_plots = FALSE,
  list_of_numswitch_to_plot = NULL
)

Arguments

input_folder

Input folder. The location of the files created by PreprocessMatrix if you specified an output_folder. This is also where the num switch array was saved. Must specify an input_folder OR EntryWise object. Default: NULL

EntryWise

Object where the ComputeEntryWisePerturbationExpectation output was saved.

prefix

Prefix of output files, if you so choose.

all_numswitch_plots

set to TRUE if you ant to plot all num switch plots (potentially very large). Default: FALSE

list_of_numswitch_to_plot

List of entries you want visualized with num switch. Should be a list of vectors. Example: list(c(0, 0), c(0, 1))

Value

plot or plots

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
## Not run: 
# Set input file
infile <- system.file("extdata", "Modules", "IGP.csv", 
    package = "PressPurt")
# Preprocess the matrix
PreProsMatrix <- PreprocessMatrix(input_file = infile, 
    output_folder = NULL, max_bound = 10, threads = 2)

# Run ComputeEntryWisePerturbationExpectation
Entrywise <- ComputeEntryWisePerturbationExpectation(PreProsMatrix = PreProsMatrix,
    distribution_type = "truncnorm", 
    input_a = 0, input_b = -2, threads = 1)

# Plot specific entries using entrywise object
list_of_numswitch_to_plot <- list(c(1, 1), c(1, 2))
GenerateEntryWiseFigures(EntryWise=Entrywise, 
    all_numswitch_plots = FALSE, 
    list_of_numswitch_to_plot=list_of_numswitch_to_plot)
     

# Plot specific entries from folder
GenerateEntryWiseFigures(input_folder = "test_r/test3", 
    all_numswitch_plots = FALSE, 
    list_of_numswitch_to_plot=list_of_numswitch_to_plot)

# Plot all numswitch plots
GenerateEntryWiseFigures(EntryWise=Entrywise, 
    all_numswitch_plots = TRUE)

## End(Not run)

PressPurt documentation built on Oct. 23, 2020, 8:07 p.m.