R/myviolinplot.R

Defines functions myviolinplot

Documented in myviolinplot

library(vioplot)
library(zoo)
#' A function to create a violin plot to compare the two samples
#'
#' @param x : vector of sample data from population 1
#' @param y : vector of sample data from population 2
#'
#' @return A violin
#' @export
#'
#' @examples
#' x = rnorm(30,10,12); y = rnorm(40,20,15); myviolinplot(x,y)
#'
myviolinplot <- function(x, y){
  title <- ("Violin plot of sample x and y")
  vioplot(x, y, names=c("Sample x", "Sample y"), main = title, col="gold")
}
ElahehJafarigol/Statpackage documentation built on May 10, 2020, 1:45 a.m.