R/pplot.R

Defines functions pplot

Documented in pplot

#' Creates a point plot between two traits of a given dataset
#' 
#' @param a Dataset being used
#' @param b First trait (Must have $ as a part of the dataset)
#' @param c Second trait (Must have $ as a part of the dataset)
#' @param d Trait to determine color of points (Also needs a $)
#' @return plot The resulting plot showing weight against hindfoot length of the dataset
#' @usage 
#' pplot(surveys, surveys$weight, surveys$hindfoot_length, surveys$sex)
#' @export

pplot <- function(a, b, c, d){
  plot <- ggplot(a, mapping = aes(x = b, y = c, color = d)) + geom_point() + geom_jitter(alpha = 0.7)
  if(is.ggplot(plot)){
    return(plot)
  }
  else{
  return("ERROR - Not a plot")} 
}
dustinmacri/R_package_Macri documentation built on Dec. 20, 2021, 2:16 a.m.