plot-dataRes: Plot dataRes object

plot.dataResR Documentation

Plot dataRes object

Description

For plotting an S3 object of type dataRes

Usage

## S3 method for class 'dataRes'
plot(
  x,
  metric = NULL,
  density = FALSE,
  ncols = NULL,
  interactive = FALSE,
  x_lab = NULL,
  x_lab_sd = NULL,
  x_lab_median = NULL,
  y_lab = NULL,
  y_lab_sd = NULL,
  y_lab_median = NULL,
  x_lab_size = 11,
  y_lab_size = 11,
  x_lab_angle = NULL,
  title_lab = NULL,
  title_lab_sd = NULL,
  title_lab_median = NULL,
  title_lab_size = 14,
  legend_lab = NULL,
  legend_position = "right",
  point_size = 2,
  bin_width = 1,
  bw_theme = TRUE,
  palette = NULL,
  ...
)

Arguments

x

object of class dataRes, created by the edata_summary function

metric

character string indicating which metric to use in plot: 'mean', 'median', 'sd, 'pct_obs', 'min', or 'max'

density

logical value, defaults to FALSE. If TRUE, a density plot of the specified metric is returned.

ncols

integer value specifying the number columns for the histogram facet_wrap. This argument is used when metric is not null. The default is NULL.

interactive

logical value. If TRUE, produces an interactive plot.

x_lab

character string specifying the x-axis label when the metric argument is NULL. The default is NULL in which case the x-axis label will be "count".

x_lab_sd

character string used for the x-axis label for the mean/standard deviation plot when the metric argument is not NULL.

x_lab_median

character string used for the x-axis label for the mean/median plot when the metric argument is not NULL.

y_lab

character string specifying the y-axis label. The default is NULL in which case the y-axis label will be the metric selected for the metric argument.

y_lab_sd

character string used for the y-axis label for the mean/standard deviation plot when the metric argument is not NULL.

y_lab_median

character string used for the y-axis label for the mean/median plot when the metric argument is not NULL.

x_lab_size

integer value indicating the font size for the x-axis. The default is 11.

y_lab_size

integer value indicating the font size for the y-axis. The default is 11.

x_lab_angle

integer value indicating the angle of x-axis labels

title_lab

character string specifying the plot title when the metric argument is NULL.

title_lab_sd

character string used for the plot title for the mean/standard deviation plot when the metric argument is not NULL.

title_lab_median

character string used for the plot title for the mean/median plot when the metric argument is not NULL.

title_lab_size

integer value indicating the font size of the plot title. The default is 14.

legend_lab

character string specifying the legend title.

legend_position

character string specifying the position of the legend. Can be one of "right", "left", "top", or "bottom". The default is "right".

point_size

integer specifying the size of the points. The default is 2.

bin_width

integer indicating the bin width in a histogram. The default is 0.5.

bw_theme

logical value. If TRUE, uses the ggplot2 black and white theme.

palette

character string indicating the name of the RColorBrewer palette to use. For a list of available options see the details section in RColorBrewer.

...

further arguments passed to or from other methods.

Details

This function can only create plots for dataRes objects whose 'by' = 'molecule' and 'groupvar' attribute is non NULL

Value

ggplot2 plot object if interactive is FALSE, or plotly plot object if interactive is TRUE

Examples


library(pmartRdata)
mylipid <- edata_transform(omicsData = lipid_pos_object, data_scale = "log2")
result <- edata_summary(
  omicsData = mylipid,
  by = "molecule",
  groupvar = "Virus"
)
plot(result)


pmartR/pmartR documentation built on March 4, 2024, 8:32 a.m.