compare_plot: Comparison plot generator This function help generate...

View source: R/compare_plot.R

compare_plotR Documentation

Comparison plot generator This function help generate comparsion plot including bar plot, box plot, and violin plot

Description

Comparison plot generator This function help generate comparsion plot including bar plot, box plot, and violin plot

Usage

compare_plot(
  inputframe,
  treat_location,
  value_location,
  aes_col = NULL,
  point = TRUE,
  facet_location = NULL,
  ylab_text = NULL
)

Arguments

inputframe

A data frame contain information for visualization.

treat_location

Numeric. Treatment column number in inputframe.

value_location

Numeric. Value column number in inputframe.

aes_col

Named character string, default:NULL. A set of aesthetic character to map treatment to.

point

Logical. If draw point on bar, box and violin plot. Default:TRUE.

facet_location

Numeric, default:NULL. Facet column number in inputframe.

ylab_text

Character. Text for y axis.

Value

A list contained plot and statistics

Examples

data("iris")
results=compare_plot(inputframe=iris,treat_location=5,
                     value_location=1,ylab_text = "Sepal Length")

#Check statistics
results$Statistics
#Extract plot
results$Barplot
results$Boxplot
results$Violinplot


iris$Treat2=rep(c(rep("A",25),rep("B",25)),3)

results=compare_plot(inputframe=iris,treat_location=5,
                     value_location=1,facet_location = 6,
                     ylab_text = "Sepal Length")

#Check statistics
results$Statistics
#Extract plot
results$Barplot
results$Boxplot
results$Violinplot
#Extract combined plot
results$All_Barplot
results$All_Boxplot
results$All_Violinplot


LorMe documentation built on Sept. 13, 2024, 9:07 a.m.

Related to compare_plot in LorMe...