I am trying to make a barplot with error bars in ggplot2, I keep getting this error message: "Error in value - standard_error : non-numeric argument to binary operator"
Salinitydata <- data.frame(
value=c("0","0", "0","0","0",
"5","5", "5","5",
"10",'10',"10",'10',
"20", '20', "20", '20',"20", '20', "20") ,
Salinity=c(21,22,22,22,22,
23,22,22,22,
23,22,23,22,
25,22,24,22.5,23,24,24))
# create standard error
standard_error = 5
# Load ggplot2 package
library("ggplot2")
# Create bar plot using ggplot() function
ggplot(Salinitydata, aes(value, Salinity))+
geom_bar(stat = "identity")+
geom_errorbar(aes(ymin=value-standard_error,
ymax=value+standard_error),
width=.2)