#' 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")}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.