I am trying to add a list of points to my boxplots, however, the points only show up for one boxplot and not for the another. I was wondering if anyone could help me identify the problem. Here is the code I am using.
#graphics.off()
rm(list=ls())
# Inputs
CapeHenlopen <- c(1,4,3,15,2,3,4,1,10,7,3,1,1,1,4,44,4,2,2,5,1)
Brandywine<- c(1,75,20,15,2,104,3,14,1)
# Outputs
dev.new() # Open a new window for my boxplot
boxplot(CapeHenlopen,Brandywine, horizontal = FALSE,
xlab = c('Location'),
ylab= 'Number of Individuals',
col=c('red','blue'),
names=c('Cape Henlopen', 'Brandywine'))
stripchart(CapeHenlopen, Brandywine, vertical = TRUE, method = "stack", pch = 19, add = TRUE)
dev.copy(png,'myplot.png')
The easiest way to solve this is to convert your vectors into a data frame with a column for the location and a column for the values. This will make platting an analysis easier.