I have three y values corresponding to three x values. I just want to have a line graph between these three dots
g <- c("1","2","3")
i <- c(181.83,178.74,152.02)
df <- data.frame(g,i)
p <- ggplot(df, aes(x=g, y=i)) + geom_line() + geom_point()
Using this I get this:
First of all why does my geom_line() not work? After that I have:
se <- c(22.95,22.72,19.2)
p + geom_errorbar(aes(ymin=se,ymax=se))
And what I get is:
Why are my errorbars not centered around the data points? Why are they smushed to the bottom? Why do they seem horizontal? What can I do to fix this?



group = 1like thisggplot(df, aes(x = g, y = i, group = 1)) + geom_line() + geom_point()