plot.OpenStatsRR: plot for an 'OpenStatsRR' object

View source: R/Plots.R

plot.OpenStatsRRR Documentation

plot for an 'OpenStatsRR' object

Description

This function visualises an 'OpenStatsRR' object

Usage

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

Arguments

x

an instance of ‘OpenStatsRR' result from OpenStatsAnalysis(method = ’RR') 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 reference range plus framework

- Mosaic plot of the discretised 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.OpenStatsFE, plot.OpenStatsMM

Examples

####################################################################
# Data preparation
####################################################################
#################
# Continuous data - Creating OpenStatsList object
#################
fileCon <- system.file("extdata", "test_continuous.csv", package = "OpenStats")
test_Cont <- OpenStatsList(
  dataset = read.csv(fileCon),
  testGenotype = "experimental",
  refGenotype = "control",
  dataset.colname.genotype = "biological_sample_group",
  dataset.colname.batch = "date_of_experiment",
  dataset.colname.lifestage = NULL,
  dataset.colname.weight = "weight",
  dataset.colname.sex = "sex"
)

#################
# Reference range framework
#################
RR_result <- OpenStatsAnalysis(
  OpenStatsList = test_Cont,
  method = "RR",
  RR_formula = data_point ~ Genotype + Sex
)
plot(RR_result, col = 3:4)

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