2
Hello, I am looking for an aid to improve a script in R. I develop it with the aid of the ggplot2 package. I intend to show a graph with media and standard error and the data set points. I used the layers "geom_errorbar()" and "geom_dotplot()" .
I have found the error : "Error in FUN(X[[i]], ...) : Object 'PV. y' not found".
I think the error is in the layer "geom_errorbar()". Can anyone tell me what is wrong? Follow the example in the script:
gmed <-read.csv("https://drive.google.com/open?id=1RSpq7Tpxzt_eHEwwWzh2vPJJ1ddU1I0N",header=T, sep=',')
##gráfico
require(Rmisc)
require(ggplot2)
require(EnvStats)
require(sciplot)
require(dplyr)
#
gpv <- summarySE(gmed, measurevar="PV", groupvars=c("INT"))
summarygpv <- ggplot( gpv, aes(x="INT", y= "PV", fill= "INT"))+
scale_x_discrete(limits=c("S", "P", "G", "F"))+ #alterar ordem ítens
legenda
geom_dotplot(binwidth= 0.5,
binaxis="y",
stackdir = "center") +
geom_errorbar(aes (ymin=PV.y-se,
ymax=PV.y+se),
width = 0.25,
size=0.25)+
xlab("Tratamentos") +
ylab(" Posição Vertical (cm)") +
geom_text(aes(label = paste("N", "==",N,sep = "")),
parse = TRUE,
y=-0.15)+
geom_point(aes(y=PV.y),
size=1,show.legend = F) +
theme_bw () +
scale_fill_manual(values=c("grey75","grey25"))
summarygpv
So that the error appears the variable "PV. y" was not found, check if this is the same name in gpv.
– Thiago Fernandes