3
I seek your assistance in solving some problems in constructing a graph with average and standard error in R with the ggplot2 package and summarySE function.
In my work I evaluate the effect of competition by resource between two species of aquatic vertebrates with different sizes p/g, through the variables PV displacement and PH displacement. I have found some errors for the script execution, I present them below.
I appreciate the cooperation of all. I hope this post can help others.
Mistakes:
Error1:
gmed <- read.csv("https://drive.google.com/file/d/1X7FEhxjxAVBD-9LB6UrRUd2aMtjcwnyR/view", header = TRUE,sep = ";")
Warning message:
In scan(file = file, what = what, sep = sep, quote = quote, dec = dec, :
EOF within quoted string
Error 2:
gpv <- summarySE(gmed, measurevar="PV", groupvars=c("INT"))
Error in FUN(X[[i]], ...) : objeto 'INT' não encontrado
chart script :
gmed <- read.csv("https://drive.google.com/file/d/1X7FEhxjxAVBD-9LB6UrRUd2aMtjcwnyR/view", header = TRUE,sep = ";")
require(Rmisc)
require(ggplot2)
gpv <- summarySE(gmed, measurevar="PV", groupvars=c("INT"))
grafic.gpv <- ggplot(gpv, aes(x=INT, y=PV, fill=INT)) +
scale_x_discrete(limits=c("S", "P", "G", "F")) +
geom_dotplot(binwidth= 0.5, binaxis="y", stackdir = "center") +
geom_errorbar(aes(ymin=PV-se, ymax=PV+se), width=0.25, size=0.25) +
labs(x="Tratamentos", y="Posição Vertical (cm)") +
geom_text(aes(label=paste("N", "==",N,sep = "")), parse = TRUE, y=c(17.5, 15, 15, 22.5)) +
geom_point(aes(y=PV), size=1, show.legend = F) +
theme_bw () +
scale_fill_grey(start=0.25, end=0.75)
grafic.gpv