plot.OpenStatsFE: plot for an 'OpenStatsFE' object

View source: R/Plots.R

plot.OpenStatsFER Documentation

plot for an 'OpenStatsFE' object

Description

This function visualises an 'OpenStatsFE' object

Usage

 ## S3 method for class 'OpenStatsFE'
plot(x, main = "Mosaic plot", ask = FALSE, mfrow = c(2, 2), ...)

Arguments

x

an instance of ‘OpenStatsFE' result from OpenStatsAnalysis(method = ’FE') function

main

a string to be pasted to the title of the plots

ask

see 'ask' in 'par()' function. Default FALSE

mfrow

the screen partition. see 'mfrow' argument in the 'par' function. Default c(2,2) then all plots display in one screen.

...

other parameters that can be passed to the 'plot' function

Details

The plot function creates some visualisations for the Fisher's exact test framework:

- Mosaic plot of the response versus Genotype/Sex/LifeStage (if they exist in the data
- Mosaic plot of the Sex versus Genotype (if they exist in the data)

Value

Not applicable

Author(s)

Hamed Haseli Mashhadi <hamedhm@ebi.ac.uk>

See Also

OpenStatsAnalysis, plot.OpenStatsRR, plot.OpenStatsMM

Examples

####################################################################
# Data preparation
####################################################################
#################
# Categorical data - Creating OpenStatsList object
#################
fileCat <- system.file("extdata", "test_categorical.csv", package = "OpenStats")
test_Cat <- OpenStatsList(
  dataset = read.csv(fileCat, na.strings = "-"),
  testGenotype = "Aff3/Aff3",
  refGenotype = "+/+",
  dataset.colname.genotype = "Genotype",
  dataset.colname.batch = "Assay.Date",
  dataset.colname.lifestage = NULL,
  dataset.colname.weight = "Weight",
  dataset.colname.sex = "Sex"
)
#################
# Fisher's exact test framework
#################
FE_result <- OpenStatsAnalysis(
  OpenStatsList = test_Cat,
  method = "FE",
  FE_formula = Thoracic.Processes ~ Genotype + Sex
)
plot(FE_result, col = 1:2)

mpi2/OpenStats documentation built on Sept. 17, 2022, 3:58 p.m.